summaryrefslogtreecommitdiff
path: root/src/libudev/strv.c
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2013-08-02 20:46:21 -0400
committerAnthony G. Basile <blueness@gentoo.org>2013-08-02 20:46:21 -0400
commita3cd924ecba40190703919285f5e2ef559d32ccd (patch)
tree344f2193c6d74d41bd6d34e828434350c4304d78 /src/libudev/strv.c
parenta57c8bba0d0c81cd3f884e173ff56f25b5946cf1 (diff)
src/libudev/{strv,util}.{h,c}: reorder functions
We reorder the functions prototypes and definitions to match upstream as in commit aa417a4d83999f6d7f092161d5c411b8cbce9977. The order was lost when that commit was revert and the functions re-introduced in later commits. Preserving the order helps to better track upstream changes when doing a diff between files. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/libudev/strv.c')
-rw-r--r--src/libudev/strv.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/libudev/strv.c b/src/libudev/strv.c
index 45fb6b24a2..3619701e9d 100644
--- a/src/libudev/strv.c
+++ b/src/libudev/strv.c
@@ -144,32 +144,23 @@ char **strv_new(const char *x, ...) {
int strv_push(char ***l, char *value) {
char **c;
- char *v;
unsigned n;
if (!value)
return 0;
- v = strdup(value);
- if (!v)
- return -ENOMEM;
-
n = strv_length(*l);
c = realloc(*l, sizeof(char*) * (n + 2));
- if (!c) {
- free(v);
if (!c)
return -ENOMEM;
- }
- c[n] = v;
c[n] = value;
c[n+1] = NULL;
*l = c;
return 0;
}
-
+
int strv_extend(char ***l, const char *value) {
char *v;
int r;