.ifr_data = (char*)&args2
};
- strncpy(ifr.ifr_name, iface->name, IFNAMSIZ);
+ strlcpy(ifr.ifr_name, iface->name, IFNAMSIZ);
if (ioctl(cfg->g_sock, SIOCDEVPRIVATE, &ifr) < 0)
/* This can happen with a 64bit kernel and 32bit
bmaster = hardware->h_data;
memset(bmaster, 0, sizeof(struct bond_master));
bmaster->index = master->index;
- strncpy(bmaster->name, master->name, IFNAMSIZ);
+ strlcpy(bmaster->name, master->name, IFNAMSIZ);
lldpd_port_cleanup(&hardware->h_lport, 0);
}
return NULL;
}
- while ((fgets(line, 1024, fp) != NULL)) {
+ while ((fgets(line, sizeof(line), fp) != NULL)) {
key = strtok(line, "=");
val = strtok(NULL, "=");
- if (strncmp(key, "PRETTY_NAME", 1024) == 0) {
- strncpy(release, val, 1024);
+ if (strncmp(key, "PRETTY_NAME", sizeof(line)) == 0) {
+ strlcpy(release, val, sizeof(line));
break;
}
}