diff options
| author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2026-06-02 17:04:13 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-02 17:04:13 -0400 |
| commit | 252b9646c1cb0538123d51ced4a733f3dcfc266b (patch) | |
| tree | 84b300af068db367bd9f3262487aeef3c7ba22d0 /src/cli/stasis/args.c | |
| parent | d8ee8c27444a56bb98dd8bd67a019a1e9efbcc10 (diff) | |
| download | stasis-252b9646c1cb0538123d51ced4a733f3dcfc266b.tar.gz | |
Safe strings, finally (#145)
* Add string copy and catonate replacements
* safe_strncpy
* safe_strncat
* Replace string functions
* gbo.ini: Update tweakwcs to 0.9.0
* generic.ini: Update tweakwcs to 0.9.0
Diffstat (limited to 'src/cli/stasis/args.c')
| -rw-r--r-- | src/cli/stasis/args.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cli/stasis/args.c b/src/cli/stasis/args.c index eb096bc..c1bf031 100644 --- a/src/cli/stasis/args.c +++ b/src/cli/stasis/args.c @@ -89,20 +89,20 @@ void usage(char *progname) { char opt_long[50] = {0}; // --? [ARG]? char opt_short[50] = {0}; // -? [ARG]? - strncat(opt_long, "--", sizeof(opt_long) - strlen(opt_long) - 1); - strncat(opt_long, long_options[x].name, sizeof(opt_long) - strlen(opt_long) - 1); + safe_strncat(opt_long, "--", sizeof(opt_long)); + safe_strncat(opt_long, long_options[x].name, sizeof(opt_long)); if (long_options[x].has_arg) { - strncat(opt_long, " ARG", sizeof(opt_long) - strlen(opt_long) - 1); + safe_strncat(opt_long, " ARG", sizeof(opt_long)); } if (long_options[x].val <= 'z') { - strncat(opt_short, "-", sizeof(opt_short) - strlen(opt_short) - 1); + safe_strncat(opt_short, "-", sizeof(opt_short)); opt_short[1] = (char) long_options[x].val; if (long_options[x].has_arg) { - strncat(opt_short, " ARG", sizeof(opt_short) - strlen(opt_short) - 1); + safe_strncat(opt_short, " ARG", sizeof(opt_short)); } } else { - strncat(opt_short, " ", sizeof(opt_short) - strlen(opt_short) - 1); + safe_strncat(opt_short, " ", sizeof(opt_short)); } snprintf(tmp, sizeof(tmp) - strlen(tmp), " %%-%ds\t%%s\t\t%%s", width + 4); |
