summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-02-07 00:15:27 +0100
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-02-07 00:38:09 +0100
commit7c2d80944afb4196f2eff614e8da1450dffcbeaa (patch)
tree5cdf18700cdfd9471eaee67e78661b286b9c98f2 /src/shared
parentfa3cd7394c227ad38c5c09b2bc2d035e7fb14a76 (diff)
strv: add strv_print
Clearer, and spares the temp variable.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/strv.c10
-rw-r--r--src/shared/strv.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/shared/strv.c b/src/shared/strv.c
index 2d556f4a07..fc6104ffea 100644
--- a/src/shared/strv.c
+++ b/src/shared/strv.c
@@ -774,3 +774,13 @@ char **strv_sort(char **l) {
qsort(l, strv_length(l), sizeof(char*), str_compare);
return l;
}
+
+void strv_print(char **l) {
+ char **s;
+
+ if (!l)
+ return;
+
+ STRV_FOREACH(s, l)
+ puts(*s);
+}
diff --git a/src/shared/strv.h b/src/shared/strv.h
index fd728eff81..33c752a313 100644
--- a/src/shared/strv.h
+++ b/src/shared/strv.h
@@ -87,3 +87,4 @@ bool strv_overlap(char **a, char **b);
char **strv_sort(char **l);
+void strv_print(char **l);