[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180320202909.22166-3-stephen@networkplumber.org>
Date: Tue, 20 Mar 2018 13:29:02 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2 v2 2/9] pedit: fix strncpy warning
Newer versions of Gcc warn about string truncation.
Fix by using strlcpy.
Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
tc/m_pedit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tc/m_pedit.c b/tc/m_pedit.c
index 26549eeea899..8577f875a7c0 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;
}
--
2.16.2
Powered by blists - more mailing lists