mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 04:35:12 +02:00
xt_quota2: silence a compiler warning
libxt_quota2.c:73:3: warning: ‘strncpy’ specified bound 15 equals destination size [-Wstringop-truncation] 73 | strncpy(info->name, optarg, sizeof(info->name));
This commit is contained in:
@@ -70,7 +70,7 @@ quota_mt2_parse(int c, char **argv, int invert, unsigned int *flags,
|
|||||||
/* zero termination done on behalf of the kernel module */
|
/* zero termination done on behalf of the kernel module */
|
||||||
xtables_param_act(XTF_ONLY_ONCE, "quota", "--name", *flags & FL_NAME);
|
xtables_param_act(XTF_ONLY_ONCE, "quota", "--name", *flags & FL_NAME);
|
||||||
xtables_param_act(XTF_NO_INVERT, "quota", "--name", invert);
|
xtables_param_act(XTF_NO_INVERT, "quota", "--name", invert);
|
||||||
strncpy(info->name, optarg, sizeof(info->name));
|
snprintf(info->name, sizeof(info->name), "%s", optarg);
|
||||||
*flags |= FL_NAME;
|
*flags |= FL_NAME;
|
||||||
return true;
|
return true;
|
||||||
case 'p':
|
case 'p':
|
||||||
|
Reference in New Issue
Block a user