summaryrefslogtreecommitdiff
path: root/src/basic/strv.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-02-26 21:20:00 +0100
committerLennart Poettering <lennart@poettering.net>2018-02-26 21:20:00 +0100
commitaa484f356110d9118c44389fe8f03ee7b25a7746 (patch)
tree5a284768496b9adbb15cb6d6ca89fac547138ec7 /src/basic/strv.c
parentf2e3f3695052ce59d119758d02bec9b1021731bd (diff)
downloadsystemd-aa484f356110d9118c44389fe8f03ee7b25a7746.tar.gz
tree-wide: use reallocarray instead of our home-grown realloc_multiply (#8279)
There isn't much difference, but in general we prefer to use the standard functions. glibc provides reallocarray since version 2.26. I moved explicit_bzero is configure test to the bottom, so that the two stdlib functions are at the bottom.
Diffstat (limited to 'src/basic/strv.c')
-rw-r--r--src/basic/strv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/basic/strv.c b/src/basic/strv.c
index 68e2e874b4..020fa269d7 100644
--- a/src/basic/strv.c
+++ b/src/basic/strv.c
@@ -407,7 +407,7 @@ int strv_push(char ***l, char *value) {
if (m < n)
return -ENOMEM;
- c = realloc_multiply(*l, sizeof(char*), m);
+ c = reallocarray(*l, m, sizeof(char*));
if (!c)
return -ENOMEM;
@@ -432,7 +432,7 @@ int strv_push_pair(char ***l, char *a, char *b) {
if (m < n)
return -ENOMEM;
- c = realloc_multiply(*l, sizeof(char*), m);
+ c = reallocarray(*l, m, sizeof(char*));
if (!c)
return -ENOMEM;
@@ -546,7 +546,7 @@ int strv_extend_front(char ***l, const char *value) {
if (!v)
return -ENOMEM;
- c = realloc_multiply(*l, sizeof(char*), m);
+ c = reallocarray(*l, m, sizeof(char*));
if (!c) {
free(v);
return -ENOMEM;