summaryrefslogtreecommitdiff
path: root/src/libudev/strv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libudev/strv.c')
-rw-r--r--src/libudev/strv.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/libudev/strv.c b/src/libudev/strv.c
index 3619701e9d..cbfe2388d6 100644
--- a/src/libudev/strv.c
+++ b/src/libudev/strv.c
@@ -202,15 +202,11 @@ char **strv_remove(char **l, const char *s) {
/* Drops every occurrence of s in the string list, edits
* in-place. */
- for (f = t = l; *f; f++) {
-
- if (streq(*f, s)) {
+ for (f = t = l; *f; f++)
+ if (streq(*f, s))
free(*f);
- continue;
- }
-
- *(t++) = *f;
- }
+ else
+ *(t++) = *f;
*t = NULL;
return l;