From 7ab7529d45ee9c780f4fd7a974652043c4b504ce Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 25 Oct 2018 13:53:07 +0200 Subject: [PATCH] tmpfiles: why memset() and memcpy() if we have '=' and structured initialization? --- src/tmpfiles/tmpfiles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 945c5df9919..b1e85e22329 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -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; } -- 2.47.3