aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-12-21 12:39:38 +0100
committerHarald Welte <laforge@osmocom.org>2020-12-21 12:41:03 +0100
commit7f01b686716c7b1724fed9d5fe0bfb349eaa217f (patch)
tree706087d1e176e8539c3d8008f2fbdda7b60ae32b
parent5c96f5dbc6f41b15320e79b9a418d81e7d203c19 (diff)
gprs_ns2_fr: Avoid stringop-truncation warning
gprs_ns2_fr.c:448:2: error: ‘strncpy’ specified bound 16 equals destination size [-Werror=stringop-truncation] 448 | strncpy(req.ifr_name, netif, IFNAMSIZ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: Ied9fd1bea091075fad266258da39e674d10d4dcb
-rw-r--r--src/gb/gprs_ns2_fr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 60193027..14859610 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -445,7 +445,7 @@ static int set_ifupdown(const char *netif, bool up)
return sock;
memset(&req, 0, sizeof req);
- strncpy(req.ifr_name, netif, IFNAMSIZ);
+ OSMO_STRLCPY_ARRAY(req.ifr_name, netif);
if (up)
req.ifr_flags |= IFF_UP;