diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2018-06-01 10:50:13 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-06-16 09:46:11 +0200 |
commit | c5ae1c5ead42ad2fcf8705619d08ca3bad9f68de (patch) | |
tree | f93ed32f9b121bec4d88077d860a4f82e9273aae | |
parent | a8411d11f8e8a7e37fbb83859224813b5b25f74f (diff) | |
download | NetworkManager-c5ae1c5ead42ad2fcf8705619d08ca3bad9f68de.tar.gz |
ppp-manager: fix build with GCC 8
src/ppp/nm-ppp-manager.c: In function ‘monitor_cb’:
src/ppp/nm-ppp-manager.c:184:2: error: ‘strncpy’ specified bound 16 equals destination size [-Werror=stringop-truncation]
strncpy (req.ifr_name, priv->ip_iface, sizeof (req.ifr_name));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(cherry picked from commit 520542fc45985ea62f4f24f110a7cd0af408968d)
-rw-r--r-- | src/ppp/nm-ppp-manager.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ppp/nm-ppp-manager.c b/src/ppp/nm-ppp-manager.c index 6343df8bf4..cd0eae87fa 100644 --- a/src/ppp/nm-ppp-manager.c +++ b/src/ppp/nm-ppp-manager.c @@ -144,7 +144,7 @@ monitor_cb (gpointer user_data) memset (&stats, 0, sizeof (stats)); req.ifr_data = (caddr_t) &stats; - strncpy (req.ifr_name, priv->ip_iface, sizeof (req.ifr_name)); + nm_utils_ifname_cpy (req.ifr_name, priv->ip_iface); if (ioctl (priv->monitor_fd, SIOCGPPPSTATS, &req) < 0) { if (errno != ENODEV) _LOGW ("could not read ppp stats: %s", strerror (errno)); |