Skip to content

Commit

Permalink
Fix some compiler warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Collins <[email protected]>
  • Loading branch information
benmcollins committed Jan 15, 2025
1 parent d461d8a commit 3919e7f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions tools/jwt-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include <unistd.h>
#include <sys/wait.h>

static char *pipe_cmd;

static FILE *json_fp;
Expand All @@ -21,7 +24,10 @@ static int write_json(const char *title, const char *str)
json_fp = stdout;

if (pipe_cmd) {
pipe(pipe_fd);
if (pipe(pipe_fd)) {
perror(pipe_cmd);
exit(EXIT_FAILURE);
}

argv[2] = pipe_cmd;
pid = fork();
Expand All @@ -47,7 +53,10 @@ static int write_json(const char *title, const char *str)
fprintf(json_fp, "\033[0;95m[%s]\033[0m\n", title);

if (myfd) {
write(myfd, str, strlen(str));
if (write(myfd, str, strlen(str)) < 0) {
perror(pipe_cmd);
exit(EXIT_FAILURE);
}
} else {
fprintf(json_fp, "\033[0;96m%s\033[0m\n", str);
}
Expand Down
2 changes: 1 addition & 1 deletion tools/jwt-verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ _Noreturn static void usage(const char *error, int exit_state)
if (error)
fprintf(stderr, "ERROR: %s\n\n", error);

fprintf(stderr, "\
fprintf(stderr, "\
Usage: %1$s [OPTIONS] <token> [token(s)]\n\
%1$s [OPTIONS] -\n\
\n\
Expand Down

0 comments on commit 3919e7f

Please sign in to comment.