Skip to content

Commit

Permalink
xdu: Make format string a string lateral
Browse files Browse the repository at this point in the history
Clang 4.0.0 shows the warnings below.

```
$ CC=clang make
clang -Wall -Werror -Wextra -pedantic -std=gnu99   -c -o xdu.o xdu.c
xdu.c:218:29: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
            fprintf(stderr, usage);
                            ^~~~~
xdu.c:218:29: note: treat the string as an argument to avoid this
            fprintf(stderr, usage);
                            ^
                            "%s",
xdu.c:226:25: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
        fprintf(stderr, usage);
                        ^~~~~
xdu.c:226:25: note: treat the string as an argument to avoid this
        fprintf(stderr, usage);
                        ^
                        "%s",
```
  • Loading branch information
pmenzel committed Jul 18, 2017
1 parent 35fa410 commit d44cc5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ char **argv;
xsetup(&argc, argv);
if (argc == 1) {
if (isatty(fileno(stdin))) {
fprintf(stderr, usage);
fprintf(stderr, "%s", usage);
exit(1);
} else {
parse_file("-");
}
} else if (argc == 2 && strcmp(argv[1], "-help") != 0) {
parse_file(argv[1]);
} else {
fprintf(stderr, usage);
fprintf(stderr, "%s", usage);
exit(1);
}
top.size = fix_tree(&top);
Expand Down

0 comments on commit d44cc5d

Please sign in to comment.