count *= 2;
}
- nilist = g_realloc (nilist, count * sizeof (void*));
+ nilist = (void **) g_realloc (nilist, count * sizeof (void*));
nilist [i++] = g_strdup (name);
}
if (size)
*size = i;
+ if (!nilist)
+ nilist = (void **) g_malloc (sizeof (void*));
nilist [i] = NULL;
return nilist;
}
rx_fifo, rx_frame, tx_bytes, tx_packets, tx_errs, tx_drops,
tx_fifo, tx_colls, tx_carrier, rx_multi;
- if (error)
- *error = MONO_NETWORK_ERROR_OTHER;
+ *error = MONO_NETWORK_ERROR_OTHER;
f = fopen ("/proc/net/dev", "r");
if (!f)
char *ptr;
buf [sizeof (buf) - 1] = 0;
if ((ptr = strchr (buf, ':')) == NULL ||
- (*ptr++ = 0, sscanf (buf, "%s", cname) != 1))
+ (*ptr++ = 0, sscanf (buf, "%250s", cname) != 1))
goto out;
if (strcmp (name, cname) != 0) continue;