summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 12b23b9)
raw | patch | inline | side by side (parent: 12b23b9)
author | Florian Forster <octo@collectd.org> | |
Sun, 12 May 2013 09:53:52 +0000 (11:53 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Sun, 12 May 2013 09:53:52 +0000 (11:53 +0200) |
This allows to use arbitrarily long callback names.
Prerequisite for fixing #286.
Prerequisite for fixing #286.
src/plugin.c | patch | blob | history |
diff --git a/src/plugin.c b/src/plugin.c
index 4c6a0322f18200f92caee47adbe41ab089ee94f5..b2a8b86511efd1e905fc687301a547f83280eb0b 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
#define rf_ctx rf_super.cf_ctx
callback_func_t rf_super;
char rf_group[DATA_MAX_NAME_LEN];
- char rf_name[DATA_MAX_NAME_LEN];
+ char *rf_name;
int rf_type;
cdtime_t rf_interval;
cdtime_t rf_effective_interval;
{
DEBUG ("plugin_read_thread: Destroying the `%s' "
"callback.", rf->rf_name);
+ sfree (rf->rf_name);
destroy_callback ((callback_func_t *) rf);
rf = NULL;
continue;
rf->rf_udata.free_func = NULL;
rf->rf_ctx = plugin_get_ctx ();
rf->rf_group[0] = '\0';
- sstrncpy (rf->rf_name, name, sizeof (rf->rf_name));
+ rf->rf_name = strdup (name);
rf->rf_type = RF_SIMPLE;
rf->rf_interval = plugin_get_interval ();
sstrncpy (rf->rf_group, group, sizeof (rf->rf_group));
else
rf->rf_group[0] = '\0';
- sstrncpy (rf->rf_name, name, sizeof (rf->rf_name));
+ rf->rf_name = strdup (name);
rf->rf_type = RF_COMPLEX;
if (interval != NULL)
rf->rf_interval = TIMESPEC_TO_CDTIME_T (interval);