Skip to content

Commit

Permalink
Merge pull request #215 from suve/specify-VERSION-precision-in-printf
Browse files Browse the repository at this point in the history
Use "%.*s" when printing VERSION
  • Loading branch information
chriskuehl authored Dec 7, 2020
2 parents b45d13b + 7b83800 commit b945f3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dumb-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void handle_signal(int signum) {

void print_help(char *argv[]) {
fprintf(stderr,
"dumb-init v%*s"
"dumb-init v%.*s"
"Usage: %s [option] command [[arg] ...]\n"
"\n"
"dumb-init is a simple process supervisor that forwards signals to children.\n"
Expand Down Expand Up @@ -199,7 +199,7 @@ char **parse_command(int argc, char *argv[]) {
debug = 1;
break;
case 'V':
fprintf(stderr, "dumb-init v%*s", VERSION_len, VERSION);
fprintf(stderr, "dumb-init v%.*s", VERSION_len, VERSION);
exit(0);
case 'c':
use_setsid = 0;
Expand Down

0 comments on commit b945f3a

Please sign in to comment.