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));
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
Lubomir Rintel 2018-06-01 10:50:13 +02:00
parent 5052c8793d
commit 520542fc45

View file

@ -181,7 +181,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));