pedit: fix strncpy warning

Newer versions of Gcc warn about string truncation.
Fix by using strlcpy.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Stephen Hemminger 2018-03-19 09:43:33 -07:00
parent 6c6c0291d2
commit 95744efac4
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ reg:
noexist:
p = calloc(1, sizeof(*p));
if (p) {
strncpy(p->id, str, sizeof(p->id) - 1);
strlcpy(p->id, str, sizeof(p->id));
p->parse_peopt = pedit_parse_nopopt;
goto reg;
}