X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcurl_xml.c;h=253356c0a015345a88d7d363b98678219e0d20b5;hb=063a5e75b36173e89ffa18d32d47509f6ef968ec;hp=21e09252a376022eb9743ffdc39d2f4d86e37e4d;hpb=a5a33953ba9c8ca6a17531df5fa17181d59467c5;p=collectd.git diff --git a/src/curl_xml.c b/src/curl_xml.c index 21e09252..253356c0 100644 --- a/src/curl_xml.c +++ b/src/curl_xml.c @@ -20,6 +20,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" #include "configfile.h" @@ -116,7 +117,7 @@ static size_t cx_curl_callback (void *buf, /* {{{ */ return (0); } - if (len == 0) + if (len == 0) return (len); if ((db->buffer_fill + len) >= db->buffer_size) @@ -641,7 +642,7 @@ static int cx_curl_perform (cx_t *db, CURL *curl) /* {{{ */ return (-1); } if (db->stats != NULL) - curl_stats_dispatch (db->stats, db->curl, cx_host (db), "curl_xml", db->instance, NULL); + curl_stats_dispatch (db->stats, db->curl, cx_host (db), "curl_xml", db->instance); curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url); curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &rc); @@ -1024,7 +1025,7 @@ static int cx_config_add_url (oconfig_item_t *ci) /* {{{ */ /* If all went well, register this database for reading */ if (status == 0) { - user_data_t ud; + user_data_t ud = { 0 }; char *cb_name; if (db->instance == NULL) @@ -1033,7 +1034,6 @@ static int cx_config_add_url (oconfig_item_t *ci) /* {{{ */ DEBUG ("curl_xml plugin: Registering new read callback: %s", db->instance); - memset (&ud, 0, sizeof (ud)); ud.data = (void *) db; ud.free_func = cx_free;