From: Florian Forster Date: Sun, 12 May 2013 10:21:07 +0000 (+0200) Subject: curl_xml plugin: Allow arbitrarily long callback names. X-Git-Tag: collectd-5.4.0~43 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2f39281928f7aab4e231852e01fe82149be28cff;p=collectd.git curl_xml plugin: Allow arbitrarily long callback names. Fixes issue #286. --- diff --git a/src/curl_xml.c b/src/curl_xml.c index 0b413047..5adaf067 100644 --- a/src/curl_xml.c +++ b/src/curl_xml.c @@ -966,7 +966,7 @@ static int cx_config_add_url (oconfig_item_t *ci) /* {{{ */ if (status == 0) { user_data_t ud; - char cb_name[DATA_MAX_NAME_LEN]; + char *cb_name; if (db->instance == NULL) db->instance = strdup("default"); @@ -978,11 +978,10 @@ static int cx_config_add_url (oconfig_item_t *ci) /* {{{ */ ud.data = (void *) db; ud.free_func = cx_free; - ssnprintf (cb_name, sizeof (cb_name), "curl_xml-%s-%s", - db->instance, db->url); - - plugin_register_complex_read (/* group = */ NULL, cb_name, cx_read, + cb_name = ssnprintf_alloc ("curl_xml-%s-%s", db->instance, db->url); + plugin_register_complex_read (/* group = */ "curl_xml", cb_name, cx_read, /* interval = */ NULL, &ud); + sfree (cb_name); } else {