Skip to content

Commit

Permalink
Merge pull request #213 from suve/ensure-VERSION-is-NUL-terminated
Browse files Browse the repository at this point in the history
Ensure VERSION is NUL-terminated
  • Loading branch information
chriskuehl authored Dec 2, 2020
2 parents 2da4dc4 + 7bb2fef commit 6a0fcbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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 All @@ -144,7 +144,7 @@ void print_help(char *argv[]) {
" -V, --version Print the current version and exit.\n"
"\n"
"Full help is available online at https://github.com/Yelp/dumb-init\n",
VERSION,
VERSION_len, VERSION,
argv[0]
);
}
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);
fprintf(stderr, "dumb-init v%*s", VERSION_len, VERSION);
exit(0);
case 'c':
use_setsid = 0;
Expand Down

0 comments on commit 6a0fcbc

Please sign in to comment.