From f02c783757365340763739e58ef0e68ec13a0f8f Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Thu, 13 Oct 2022 09:07:46 +0200 Subject: [PATCH] sort: use memset to initialize structure when possible --- usr.bin/sort/file.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/usr.bin/sort/file.c b/usr.bin/sort/file.c index 3e5754442ac1..92371d7a15b2 100644 --- a/usr.bin/sort/file.c +++ b/usr.bin/sort/file.c @@ -216,9 +216,7 @@ file_list_init(struct file_list *fl, bool tmp) { if (fl) { - fl->count = 0; - fl->sz = 0; - fl->fns = NULL; + memset(fl, 0, sizeof(*fl)); fl->tmp = tmp; } } @@ -293,10 +291,8 @@ sort_list_init(struct sort_list *l) { if (l) { - l->count = 0; - l->size = 0; + memset(l, 0, sizeof(*l)); l->memsize = sizeof(struct sort_list); - l->list = NULL; } }