diff options
Diffstat (limited to 'src/basic/strv.c')
-rw-r--r-- | src/basic/strv.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/basic/strv.c b/src/basic/strv.c index 765da04a7b..3adf3c5c7e 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -266,7 +266,7 @@ int strv_split_newlines_full(char ***ret, const char *s, ExtractFlags flags) { int strv_split_full(char ***t, const char *s, const char *separators, ExtractFlags flags) { _cleanup_strv_free_ char **l = NULL; - size_t n = 0, allocated = 0; + size_t n = 0; int r; assert(t); @@ -281,7 +281,7 @@ int strv_split_full(char ***t, const char *s, const char *separators, ExtractFla if (r == 0) break; - if (!GREEDY_REALLOC(l, allocated, n + 2)) + if (!GREEDY_REALLOC(l, n + 2)) return -ENOMEM; l[n++] = TAKE_PTR(word); @@ -302,7 +302,7 @@ int strv_split_full(char ***t, const char *s, const char *separators, ExtractFla int strv_split_colon_pairs(char ***t, const char *s) { _cleanup_strv_free_ char **l = NULL; - size_t n = 0, allocated = 0; + size_t n = 0; int r; assert(t); @@ -332,7 +332,7 @@ int strv_split_colon_pairs(char ***t, const char *s) { if (!second_or_empty) return -ENOMEM; - if (!GREEDY_REALLOC(l, allocated, n + 3)) + if (!GREEDY_REALLOC(l, n + 3)) return -ENOMEM; l[n++] = TAKE_PTR(first); @@ -708,9 +708,9 @@ int strv_make_nulstr(char * const *l, char **ret, size_t *ret_size) { * is provided separately. */ - size_t n_allocated = 0, n = 0; _cleanup_free_ char *m = NULL; char * const *i; + size_t n = 0; assert(ret); assert(ret_size); @@ -720,7 +720,7 @@ int strv_make_nulstr(char * const *l, char **ret, size_t *ret_size) { z = strlen(*i); - if (!GREEDY_REALLOC(m, n_allocated, n + z + 2)) + if (!GREEDY_REALLOC(m, n + z + 2)) return -ENOMEM; memcpy(m + n, *i, z + 1); |