diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2018-03-19 09:43:33 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2018-03-29 08:30:28 -0700 |
commit | 95744efac4ffdbb9b625aedd41cd6c5636189cfe (patch) | |
tree | 97d94a7977197ab69d18dbecf8c0233b889e83b6 | |
parent | 6c6c0291d259dd9d41ff3d470a836ff3e74d00ee (diff) |
pedit: fix strncpy warning
Newer versions of Gcc warn about string truncation.
Fix by using strlcpy.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-rw-r--r-- | tc/m_pedit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tc/m_pedit.c b/tc/m_pedit.c index 26549eee..8577f875 100644 --- a/tc/m_pedit.c +++ b/tc/m_pedit.c @@ -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; } |