Date: Fri, 18 Jul 2025 15:32:27 GMT From: Warner Losh <imp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: bab21ae7629c - main - kldstat: Memory zeroing using memset() Message-ID: <202507181532.56IFWRpI084651@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bab21ae7629cb564664063de81d6ec729182b735 commit bab21ae7629cb564664063de81d6ec729182b735 Author: Nazarenko Nikita Vladimirovich <nazarenko@tuta.com> AuthorDate: 2025-07-17 22:34:46 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2025-07-18 15:30:52 +0000 kldstat: Memory zeroing using memset() Use memset() instead of the outdated bzero() function when zeroing memory. bzero() was in the POSIX.1-2001 standard. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1774 Closes: https://github.com/freebsd/freebsd-src/pull/1774 --- sbin/kldstat/kldstat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/kldstat/kldstat.c b/sbin/kldstat/kldstat.c index 79c647576440..3a90f1c97eb4 100644 --- a/sbin/kldstat/kldstat.c +++ b/sbin/kldstat/kldstat.c @@ -35,7 +35,7 @@ #include <libutil.h> #include <stdio.h> #include <stdlib.h> -#include <strings.h> +#include <string.h> #include <unistd.h> #define PTR_WIDTH ((int)(sizeof(void *) * 2 + 2)) @@ -51,7 +51,7 @@ printmod(int modid) { struct module_stat stat; - bzero(&stat, sizeof(stat)); + memset(&stat, 0, sizeof(stat)); stat.version = sizeof(struct module_stat); if (modstat(modid, &stat) < 0) { warn("can't stat module id %d", modid);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202507181532.56IFWRpI084651>