mirror of git://git.sysmocom.de/ofono
stemodem: Quiet warning about strncpy use
This commit is contained in:
parent
90758c5ffc
commit
4b8cc2fcac
|
@ -85,7 +85,7 @@ static void parse_newlink_param(struct ifinfomsg *msg, int size,
|
||||||
if (attr->rta_type == IFLA_IFNAME &&
|
if (attr->rta_type == IFLA_IFNAME &&
|
||||||
ifname != NULL) {
|
ifname != NULL) {
|
||||||
|
|
||||||
strncpy(ifname, RTA_DATA(attr), IF_NAMESIZE);
|
strncpy(ifname, RTA_DATA(attr), IF_NAMESIZE - 1);
|
||||||
ifname[IF_NAMESIZE-1] = '\0';
|
ifname[IF_NAMESIZE-1] = '\0';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <ell/ell.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#include <ofono/log.h>
|
#include <ofono/log.h>
|
||||||
|
@ -147,7 +148,7 @@ static void rtnl_callback(int ifindex, const char *ifname, void *user_data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy(gcd->interface, ifname, sizeof(gcd->interface));
|
l_strlcpy(gcd->interface, ifname, sizeof(gcd->interface));
|
||||||
gcd->ifindex = ifindex;
|
gcd->ifindex = ifindex;
|
||||||
gcd->created = TRUE;
|
gcd->created = TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue