]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tmpfiles: why memset() and memcpy() if we have '=' and structured initialization?
authorLennart Poettering <lennart@poettering.net>
Thu, 25 Oct 2018 11:53:07 +0000 (13:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 8 Nov 2018 08:52:16 +0000 (09:52 +0100)
src/tmpfiles/tmpfiles.c

index 945c5df99199a5f691a7467a65e9fe3892f25706..b1e85e223298f9ce5eb72080bc9a0eaa8f0a9a6d 100644 (file)
@@ -2801,12 +2801,12 @@ static int parse_line(const char *fname, unsigned line, const char *buffer, bool
         if (!GREEDY_REALLOC(existing->items, existing->allocated, existing->n_items + 1))
                 return log_oom();
 
-        memcpy(existing->items + existing->n_items++, &i, sizeof(i));
+        existing->items[existing->n_items++] = i;
+        i = (struct Item) {};
 
         /* Sort item array, to enforce stable ordering of application */
         typesafe_qsort(existing->items, existing->n_items, item_compare);
 
-        zero(i);
         return 0;
 }