return &cv;
err:
- if (cb)
- nl_cb_put(cb);
-
if (req)
nlmsg_free(req);
((ifidx < 0) || (cifidx < ifidx)))
{
ifidx = cifidx;
- strncpy(nif, e->d_name, sizeof(nif));
+ strncpy(nif, e->d_name, sizeof(nif) - 1);
}
}
}
if (phy)
{
snprintf(buf, sizeof(buf), "/var/run/wifi-%s.pid", phy);
- if ((fd = open(buf, O_RDONLY)) > 0)
+ if ((fd = open(buf, O_RDONLY)) >= 0)
{
if (read(fd, buf, sizeof(buf)) > 0)
pid = atoi(buf);
static int nl80211_get_hardware_id(const char *ifname, char *buf)
{
- int rv;
+ int rv = -1;
char *res;
/* Got a radioX pseudo interface, find some interface on it or create one */