Code

Varnish plugin: more concise formatting of plugin instance.
authorMarc Fournier <marc.fournier@camptocamp.com>
Tue, 22 Jun 2010 09:10:56 +0000 (11:10 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Tue, 22 Jun 2010 09:10:56 +0000 (11:10 +0200)
src/varnish.c

index 23253127b7e8dd542ec08ff677669c8e1a580603..df36cd1fafb32f9c0d43f5c126bc98f94ac8d061 100644 (file)
@@ -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));