Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/gen Test the proper array index. Discovered by spar...



details:   https://anonhg.NetBSD.org/src/rev/51794d89b757
branches:  trunk
changeset: 763378:51794d89b757
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Mar 18 09:07:20 2011 +0000

description:
Test the proper array index. Discovered by sparc64 automatic test runs.

diffstat:

 lib/libc/gen/unvis.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r ec03d468673a -r 51794d89b757 lib/libc/gen/unvis.c
--- a/lib/libc/gen/unvis.c      Fri Mar 18 08:26:19 2011 +0000
+++ b/lib/libc/gen/unvis.c      Fri Mar 18 09:07:20 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: unvis.c,v 1.35 2011/03/13 07:40:44 mrg Exp $   */
+/*     $NetBSD: unvis.c,v 1.36 2011/03/18 09:07:20 martin Exp $        */
 
 /*-
  * Copyright (c) 1989, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)unvis.c    8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: unvis.c,v 1.35 2011/03/13 07:40:44 mrg Exp $");
+__RCSID("$NetBSD: unvis.c,v 1.36 2011/03/18 09:07:20 martin Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -438,7 +438,7 @@
                                break;
                }
 
-               if (*cp == __arraycount(nv))
+               if (ia == __arraycount(nv))
                        goto bad;
 
                if (uc != 0) {



Home | Main Index | Thread Index | Old Index