[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180319165638.30166-5-stephen@networkplumber.org>
Date: Mon, 19 Mar 2018 09:56:37 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2 4/5] 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