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:
parent
6c6c0291d2
commit
95744efac4
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue