X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fonewire.c;h=42bd1eb8213c5e0700584bea21c381711900a1e6;hb=db35efb33e81d0a013e09a8a6ffa362ad5962f7c;hp=3c3afdf69d80f9253ae738c33ccc8247a7538f3a;hpb=9d5c9e04aac3689f49098cba0e630128c0ef4caa;p=collectd.git diff --git a/src/onewire.c b/src/onewire.c index 3c3afdf6..42bd1eb8 100644 --- a/src/onewire.c +++ b/src/onewire.c @@ -176,11 +176,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"); @@ -459,7 +459,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++)