Source-Changes-HG archive

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

[src/trunk]: src/lib/libedit use arraycount



details:   https://anonhg.NetBSD.org/src/rev/2eb6f3a7d618
branches:  trunk
changeset: 777995:2eb6f3a7d618
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Mar 11 21:14:56 2012 +0000

description:
use arraycount

diffstat:

 lib/libedit/el.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 91aad04cdb53 -r 2eb6f3a7d618 lib/libedit/el.c
--- a/lib/libedit/el.c  Sun Mar 11 20:02:55 2012 +0000
+++ b/lib/libedit/el.c  Sun Mar 11 21:14:56 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: el.c,v 1.69 2011/11/18 20:22:03 christos Exp $ */
+/*     $NetBSD: el.c,v 1.70 2012/03/11 21:14:56 christos Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)el.c       8.2 (Berkeley) 1/3/94";
 #else
-__RCSID("$NetBSD: el.c,v 1.69 2011/11/18 20:22:03 christos Exp $");
+__RCSID("$NetBSD: el.c,v 1.70 2012/03/11 21:14:56 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -219,7 +219,7 @@
                const Char *argv[20];
                int i;
 
-               for (i = 1; i < 20; i++)
+               for (i = 1; i < (int)__arraycount(argv); i++)
                        if ((argv[i] = va_arg(ap, Char *)) == NULL)
                                break;
 
@@ -419,7 +419,7 @@
                char *argv[20];
                int i;
 
-               for (i = 1; i < (int)(sizeof(argv) / sizeof(argv[0])); i++)
+               for (i = 1; i < (int)__arraycount(argv); i++)
                        if ((argv[i] = va_arg(ap, char *)) == NULL)
                                break;
 



Home | Main Index | Thread Index | Old Index