X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fonewire.c;h=f1030867b18e157a69d18736d59a8de4e2c4e13e;hb=f35f67df9ccfb80c001ed0befcce8bb90ebb2a07;hp=58c35e1eb83be009b342fbfbb7af8f2a7642cb2b;hpb=d38c16d60f9d1b10cb60f010ce086135e6ecbe07;p=collectd.git diff --git a/src/onewire.c b/src/onewire.c index 58c35e1e..f1030867 100644 --- a/src/onewire.c +++ b/src/onewire.c @@ -20,6 +20,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" #include "utils_ignorelist.h" @@ -176,11 +177,11 @@ static int direct_list_insert(const char * config) { regmatch_t pmatch[3]; size_t nmatch = 3; - direct_access_element_t *element = NULL; + direct_access_element_t *element; DEBUG ("onewire plugin: direct_list_insert <%s>", config); - element = (direct_access_element_t *) malloc (sizeof(*element)); + element = malloc (sizeof (*element)); if (element == NULL) { ERROR ("onewire plugin: direct_list_insert - cannot allocate element"); @@ -415,11 +416,11 @@ static int cow_read_ds2409 (const char *path) int status; status = ssnprintf (subpath, sizeof (subpath), "%s/main", path); - if ((status > 0) && (status < sizeof (subpath))) + if ((status > 0) && (status < (int) sizeof (subpath))) cow_read_bus (subpath); status = ssnprintf (subpath, sizeof (subpath), "%s/aux", path); - if ((status > 0) && (status < sizeof (subpath))) + if ((status > 0) && (status < (int) sizeof (subpath))) cow_read_bus (subpath); return (0); @@ -459,7 +460,7 @@ static int cow_read_bus (const char *path) else status = ssnprintf (subpath, sizeof (subpath), "%s/%s", path, buffer_ptr); - if ((status <= 0) || (status >= sizeof (subpath))) + if ((status <= 0) || (status >= (int) sizeof (subpath))) continue; for (i = 0; i < ow_family_features_num; i++)