Gcc is too stupid to realize that:
const char *usage="String which has no percent signs";
com_err(progname, 0, usage);
is OK. I refuse to bow to stupidity with:
com_err(progname, 0, "%s", usage);
but I will use the string directly for the sake of people who like to
build with -Werror=format-security.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
int fd;
int c;
int preserve = 0;
- const char *dump_usage = "Usage: dump_inode [-p] <file> <output_file>";
char *in_fn, *out_fn;
reset_getopt();
preserve++;
break;
default:
- com_err(argv[0], 0, dump_usage);
+ print_usage:
+ com_err(argv[0], 0, "Usage: dump_inode [-p] "
+ "<file> <output_file>");
return;
}
}
- if (optind != argc-2) {
- com_err(argv[0], 0, dump_usage);
- return;
- }
+ if (optind != argc-2)
+ goto print_usage;
if (check_fs_open(argv[0]))
return;
char *cmd_file = 0;
int sci_idx;
int exit_status = 0;
- const char *usage = "Usage: test_ss [-R request] [-f cmd_file]";
while ((c = getopt (argc, argv, "wR:f:")) != EOF) {
switch (c) {
cmd_file = optarg;
break;
default:
- com_err(argv[0], 0, usage);
+ com_err(argv[0], 0, "Usage: test_ss [-R request] "
+ "[-f cmd_file]");
exit(1);
}
}
{
int retval;
int sci_idx;
- const char *usage = "Usage: test_icount [-R request] [-f cmd_file]";
int c;
char *request = 0;
int exit_status = 0;
cmd_file = optarg;
break;
default:
- com_err(argv[0], 0, usage);
+ com_err(argv[0], 0, "Usage: test_icount "
+ "[-R request] [-f cmd_file]");
exit(1);
}
}