chiark / gitweb /
rework systemd's own process environment handling/passing
[elogind.git] / src / shared / strv.c
index a5ce7e9593652f9f095b1801454fd061caf69034..3e7778d61ca663eab8c2f23f9d024ef14ffa842c 100644 (file)
@@ -387,6 +387,21 @@ fail:
         return NULL;
 }
 
+char **strv_appendf(char **l, const char *format, ...) {
+        va_list ap;
+        _cleanup_free_ char *s = NULL;
+        int r;
+
+        va_start(ap, format);
+        r = vasprintf(&s, format, ap);
+        va_end(ap);
+
+        if (r < 0)
+                return NULL;
+
+        return strv_append(l, s);
+}
+
 int strv_push(char ***l, char *value) {
         char **c;
         unsigned n;