mirror of
https://github.com/mirror/wget.git
synced 2025-03-25 01:00:13 +08:00
* src/init.c (setoptval): Silence Coverity (Coverity #1419648)
This commit is contained in:
parent
ada3396c72
commit
9df2e0d746
@ -957,11 +957,13 @@ void
|
||||
setoptval (const char *com, const char *val, const char *optname)
|
||||
{
|
||||
/* Prepend "--" to OPTNAME. */
|
||||
char dd_optname[2 + MAX_LONGOPTION + 1] = "--";
|
||||
char dd_optname[2 + MAX_LONGOPTION + 1];
|
||||
|
||||
strcpy (dd_optname + 2, optname);
|
||||
if ((unsigned) snprintf(dd_optname sizeof (dd_optname), "--%s", optname) > sizeof (dd_optname))
|
||||
exit (WGET_EXIT_PARSE_ERROR);
|
||||
|
||||
assert (val != NULL);
|
||||
|
||||
if (!setval_internal (command_by_name (com), dd_optname, val))
|
||||
exit (WGET_EXIT_PARSE_ERROR);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user