tmpfiles: why memset() and memcpy() if we have '=' and structured initialization?
This commit is contained in:
parent
96d10d7837
commit
7ab7529d45
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue