Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/sysinst Use strlcpy() to copy the wedge device name...
details: https://anonhg.NetBSD.org/src/rev/5efd638bc745
branches: trunk
changeset: 984698:5efd638bc745
user: martin <martin%NetBSD.org@localhost>
date: Sat Jul 17 19:27:22 2021 +0000
description:
Use strlcpy() to copy the wedge device name (the code still assumes
the string is short enough and 0 terminated, but now gcc is happy).
diffstat:
usr.sbin/sysinst/gpt.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (18 lines):
diff -r 054b6959b790 -r 5efd638bc745 usr.sbin/sysinst/gpt.c
--- a/usr.sbin/sysinst/gpt.c Sat Jul 17 18:07:22 2021 +0000
+++ b/usr.sbin/sysinst/gpt.c Sat Jul 17 19:27:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gpt.c,v 1.25 2021/07/17 18:07:22 martin Exp $ */
+/* $NetBSD: gpt.c,v 1.26 2021/07/17 19:27:22 martin Exp $ */
/*
* Copyright 2018 The NetBSD Foundation, Inc.
@@ -1380,7 +1380,7 @@
if (found)
continue;
memset(&delw, 0, sizeof(delw));
- strncpy(delw.dkw_devname, devname, sizeof(delw.dkw_devname));
+ strlcpy(delw.dkw_devname, devname, sizeof(delw.dkw_devname));
(void)ioctl(diskfd, DIOCDWEDGE, &delw);
}
Home |
Main Index |
Thread Index |
Old Index