From: Marc Fournier Date: Tue, 22 Jun 2010 09:10:56 +0000 (+0200) Subject: Varnish plugin: more concise formatting of plugin instance. X-Git-Tag: collectd-5.0.0-beta0~99^2~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=1f3624e551c233c72121e4bf868c849f74e58058;p=collectd.git Varnish plugin: more concise formatting of plugin instance. --- diff --git a/src/varnish.c b/src/varnish.c index 23253127..df36cd1f 100644 --- a/src/varnish.c +++ b/src/varnish.c @@ -167,10 +167,8 @@ static int varnish_submit (const char *plugin_instance, /* {{{ */ if (plugin_instance == NULL) plugin_instance = "default"; - sstrncpy (vl.plugin_instance, plugin_instance, - sizeof (vl.plugin_instance)); - strncat(vl.plugin_instance, "-", 1); - strncat(vl.plugin_instance, category, sizeof(category)); + ssnprintf(vl.plugin_instance, sizeof (vl.plugin_instance), + "%s-%s", plugin_instance, category); sstrncpy(vl.type, type, sizeof(vl.type));