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 2325312..df36cd1 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));