git: e891183e60ce - stable/13 - sort: use memset to initialize structure when possible

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Wed, 19 Oct 2022 08:01:33 UTC
The branch stable/13 has been updated by bapt:

URL: https://cgit.FreeBSD.org/src/commit/?id=e891183e60cee62a05d58b173fabd7876d522008

commit e891183e60cee62a05d58b173fabd7876d522008
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2022-10-13 07:07:46 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2022-10-19 07:59:29 +0000

    sort: use memset to initialize structure when possible
    
    (cherry picked from commit f02c783757365340763739e58ef0e68ec13a0f8f)
---
 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 437be09819b5..2e3b4e0a4350 100644
--- a/usr.bin/sort/file.c
+++ b/usr.bin/sort/file.c
@@ -208,9 +208,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;
 	}
 }
@@ -285,10 +283,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;
 	}
 }