projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-5.5'
[collectd.git]
/
src
/
madwifi.c
diff --git
a/src/madwifi.c
b/src/madwifi.c
index
13301ff
..
d0b2f83
100644
(file)
--- a/
src/madwifi.c
+++ b/
src/madwifi.c
@@
-96,7
+96,6
@@
#include <dirent.h>
#include <sys/ioctl.h>
#include <dirent.h>
#include <sys/ioctl.h>
-#include <sys/socket.h>
#if !KERNEL_LINUX
# error "No applicable input method."
#if !KERNEL_LINUX
# error "No applicable input method."
@@
-368,14
+367,14
@@
static int init_state = 0;
static inline int item_watched(int i)
{
assert (i >= 0);
static inline int item_watched(int i)
{
assert (i >= 0);
- assert (
i
< ((STATIC_ARRAY_SIZE (watch_items) + 1) * 32));
+ assert (
((size_t) i)
< ((STATIC_ARRAY_SIZE (watch_items) + 1) * 32));
return watch_items[i / 32] & FLAG (i);
}
static inline int item_summed(int i)
{
assert (i >= 0);
return watch_items[i / 32] & FLAG (i);
}
static inline int item_summed(int i)
{
assert (i >= 0);
- assert (
i
< ((STATIC_ARRAY_SIZE (misc_items) + 1) * 32));
+ assert (
((size_t) i)
< ((STATIC_ARRAY_SIZE (misc_items) + 1) * 32));
return misc_items[i / 32] & FLAG (i);
}
return misc_items[i / 32] & FLAG (i);
}
@@
-420,8
+419,8
@@
static int watchitem_find (const char *name)
static int madwifi_real_init (void)
{
static int madwifi_real_init (void)
{
-
in
t max = STATIC_ARRAY_SIZE (specs);
-
in
t i;
+
size_
t max = STATIC_ARRAY_SIZE (specs);
+
size_
t i;
for (i = 0; i < STATIC_ARRAY_SIZE (bounds); i++)
bounds[i] = 0;
for (i = 0; i < STATIC_ARRAY_SIZE (bounds); i++)
bounds[i] = 0;
@@
-618,7
+617,7
@@
process_stat_struct (int which, const void *ptr, const char *dev, const char *ma
int i;
assert (which >= 1);
int i;
assert (which >= 1);
- assert (
which
< STATIC_ARRAY_SIZE (bounds));
+ assert (
((size_t) which)
< STATIC_ARRAY_SIZE (bounds));
for (i = bounds[which - 1]; i < bounds[which]; i++)
{
for (i = bounds[which - 1]; i < bounds[which]; i++)
{
@@
-754,7
+753,8
@@
process_stations (int sk, const char *dev)
uint8_t buf[24*1024];
struct iwreq iwr;
uint8_t *cp;
uint8_t buf[24*1024];
struct iwreq iwr;
uint8_t *cp;
- int len, nodes;
+ int nodes;
+ size_t len;
int status;
memset (&iwr, 0, sizeof (iwr));
int status;
memset (&iwr, 0, sizeof (iwr));
@@
-821,15
+821,16
@@
check_devname (const char *dev)
if (dev[0] == '.')
return 0;
if (dev[0] == '.')
return 0;
-
+
ssnprintf (buf, sizeof (buf), "/sys/class/net/%s/device/driver", dev);
ssnprintf (buf, sizeof (buf), "/sys/class/net/%s/device/driver", dev);
- buf[sizeof (buf) - 1] =
0
;
+ buf[sizeof (buf) - 1] =
'\0'
;
- memset (buf2, 0, sizeof (buf2));
i = readlink (buf, buf2, sizeof (buf2) - 1);
if (i < 0)
return 0;
i = readlink (buf, buf2, sizeof (buf2) - 1);
if (i < 0)
return 0;
+ buf2[i] = '\0';
+
if (strstr (buf2, "/drivers/ath_") == NULL)
return 0;
return 1;
if (strstr (buf2, "/drivers/ath_") == NULL)
return 0;
return 1;