From 2f39281928f7aab4e231852e01fe82149be28cff Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 12 May 2013 12:21:07 +0200 Subject: [PATCH] curl_xml plugin: Allow arbitrarily long callback names. Fixes issue #286. --- src/curl_xml.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 { -- 2.11.0