diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-23 01:26:03 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-04-23 01:26:27 -0400 |
| commit | 44ed1c60ad8f838bfb6cfff26683bf706285552a (patch) | |
| tree | e4bae9ececbe5fdddeec4276222132a3e85c4d42 /src/cli/stasis | |
| parent | 821f58a4c54fe8c3fc33fbefd6afb1d7b8b69419 (diff) | |
| download | stasis-44ed1c60ad8f838bfb6cfff26683bf706285552a.tar.gz | |
Fix snprintfs
Diffstat (limited to 'src/cli/stasis')
| -rw-r--r-- | src/cli/stasis/args.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/cli/stasis/args.c b/src/cli/stasis/args.c index 98b4479..e1c49fe 100644 --- a/src/cli/stasis/args.c +++ b/src/cli/stasis/args.c @@ -105,9 +105,7 @@ void usage(char *progname) { strncat(opt_short, " ", sizeof(opt_short) - strlen(opt_short) - 1); } - const char *opt_fmt = " %%-%ds\t%%s\t\t%%s"; - size_t opt_fmt_len = snprintf(NULL, 0, opt_fmt, width); - snprintf(tmp, sizeof(tmp) - opt_fmt_len, opt_fmt, width + 4); + snprintf(tmp, sizeof(tmp) - strlen(tmp), " %%-%ds\t%%s\t\t%%s", width + 4); snprintf(output, sizeof(output), tmp, opt_long, opt_short, long_options_help[x]); puts(output); } |
