diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-02-01 10:11:02 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-02-01 10:11:02 +0100 |
commit | e7b2ea7c97714e202829841f7ef6d21171474965 (patch) | |
tree | fbb44073c149b1869584522860eb93e1d6461f36 /src/basic/strv.c | |
parent | sysusers: allow force reusing existing user/group IDs (#8037) (diff) | |
download | systemd-e7b2ea7c97714e202829841f7ef6d21171474965.tar.xz systemd-e7b2ea7c97714e202829841f7ef6d21171474965.zip |
strv: drop strv_join_quoted() (#8057)
The function `strv_join_quoted()` is now not used, and has a bug
in the buffer size calculation when the strings needs to escaped,
as reported in #8056.
So, let's remove the function.
Closes #8056.
Diffstat (limited to 'src/basic/strv.c')
-rw-r--r-- | src/basic/strv.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/basic/strv.c b/src/basic/strv.c index 54c701aee2..1103245a36 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -393,42 +393,6 @@ char *strv_join(char **l, const char *separator) { return r; } -char *strv_join_quoted(char **l) { - char *buf = NULL; - char **s; - size_t allocated = 0, len = 0; - - STRV_FOREACH(s, l) { - /* assuming here that escaped string cannot be more - * than twice as long, and reserving space for the - * separator and quotes. - */ - _cleanup_free_ char *esc = NULL; - size_t needed; - - if (!GREEDY_REALLOC(buf, allocated, - len + strlen(*s) * 2 + 3)) - goto oom; - - esc = cescape(*s); - if (!esc) - goto oom; - - needed = snprintf(buf + len, allocated - len, "%s\"%s\"", - len > 0 ? " " : "", esc); - assert(needed < allocated - len); - len += needed; - } - - if (!buf) - buf = malloc0(1); - - return buf; - - oom: - return mfree(buf); -} - int strv_push(char ***l, char *value) { char **c; unsigned n, m; |