avoid a format-overflow warning

options.c: In function ‘option_help’:
options.c:8820:55: warning: ‘%s’ directive writing up to 255 bytes into a region of size 220 [-Wformat-overflow=]
 8820 |     Sprintf(buf, "Set options as OPTIONS=<options> in %s", configfile);
      |                                                       ^~   ~~~~~~~~~~
This commit is contained in:
nhmall
2022-09-17 19:29:09 -04:00
parent 6151623cce
commit 2f7b202530

View File

@@ -8817,7 +8817,8 @@ option_help(void)
winid datawin;
datawin = create_nhwindow(NHW_TEXT);
Sprintf(buf, "Set options as OPTIONS=<options> in %s", configfile);
Snprintf(buf, sizeof buf,
"Set options as OPTIONS=<options> in %s", configfile);
opt_intro[CONFIG_SLOT] = (const char *) buf;
for (i = 0; opt_intro[i]; i++)
putstr(datawin, 0, opt_intro[i]);