Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/dkwedge use arraycount.



details:   https://anonhg.NetBSD.org/src/rev/0f4d46e889fc
branches:  trunk
changeset: 826474:0f4d46e889fc
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Sep 07 10:18:26 2017 +0000

description:
use arraycount.

diffstat:

 sys/dev/dkwedge/dkwedge_gpt.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 7ace24359100 -r 0f4d46e889fc sys/dev/dkwedge/dkwedge_gpt.c
--- a/sys/dev/dkwedge/dkwedge_gpt.c     Thu Sep 07 06:40:42 2017 +0000
+++ b/sys/dev/dkwedge/dkwedge_gpt.c     Thu Sep 07 10:18:26 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dkwedge_gpt.c,v 1.19 2017/09/06 18:21:17 christos Exp $        */
+/*     $NetBSD: dkwedge_gpt.c,v 1.20 2017/09/07 10:18:26 christos Exp $        */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dkwedge_gpt.c,v 1.19 2017/09/06 18:21:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dkwedge_gpt.c,v 1.20 2017/09/07 10:18:26 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -252,7 +252,7 @@
                else {
                        c = dkw.dkw_wname;
                        r = sizeof(dkw.dkw_wname) - 1;
-                       for (j = 0; j < sizeof(ent->ent_name)
+                       for (j = 0; j < __arraycount(ent->ent_name)
                            && ent->ent_name[j] != 0x0000; j++) {
                                n = wput_utf8(c, r, le16toh(ent->ent_name[j]));
                                if (n == 0)



Home | Main Index | Thread Index | Old Index