netfilter: xt_helper: Use sizeof(variable) instead of literal number

It's better to use sizeof(info->name)-1 as index to force set the string
tail instead of literal number '29'.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
Gao Feng 2016-09-20 10:31:04 +08:00 committed by Pablo Neira Ayuso
parent 7bdc66242d
commit b9d80f83bf
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ static int helper_mt_check(const struct xt_mtchk_param *par)
par->family);
return ret;
}
info->name[29] = '\0';
info->name[sizeof(info->name) - 1] = '\0';
return 0;
}