From 43bf29f35061004d58dbb62eeb6e1674b52bcd72 Mon Sep 17 00:00:00 2001 From: Redmar Date: Wed, 18 Jul 2018 08:53:07 +0200 Subject: [PATCH] Fix minor issues format-security issues Compiling prune.c fails when compiling with -Werror=format-security on a small number of fprintf statements. This commit fixes this by specifying the %s explicitly --- src/prune.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/prune.c b/src/prune.c index 9070e95e..41221b13 100755 --- a/src/prune.c +++ b/src/prune.c @@ -184,7 +184,7 @@ struct parameters get_params(int argc, char *argv[]) if (COMMAND_LINE == params.lbl_src) { /* optind is now index of 1st label */ if ((argc - optind) < 1) { - fprintf(stderr, USAGE); + fprintf(stderr, "%s", USAGE); exit(EXIT_FAILURE); } for (; optind < argc; optind++) { @@ -196,8 +196,8 @@ struct parameters get_params(int argc, char *argv[]) } else if (IN_FILE == params.lbl_src) { /* optind is now index of label file name */ if ((argc - optind) < 1) { - fprintf(stderr, USAGE); - fprintf(stderr, "optind = %d (should be >= 1)\n"); + fprintf(stderr, "%s", USAGE); + fprintf(stderr, "optind = %d (should be >= 1)\n", optind); exit(EXIT_FAILURE); } else if ((argc - optind) > 1) { fprintf (stderr, "WARNING: expecting two arguments, extra arguments will be ignored.\n");