Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/ftp use sizeof() and array notation.



details:   https://anonhg.NetBSD.org/src/rev/a22df72d2f9f
branches:  trunk
changeset: 343490:a22df72d2f9f
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Feb 06 21:23:09 2016 +0000

description:
use sizeof() and array notation.

diffstat:

 usr.bin/ftp/cmds.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r 8f77821e1e86 -r a22df72d2f9f usr.bin/ftp/cmds.c
--- a/usr.bin/ftp/cmds.c        Sat Feb 06 20:23:39 2016 +0000
+++ b/usr.bin/ftp/cmds.c        Sat Feb 06 21:23:09 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cmds.c,v 1.135 2012/12/22 16:57:09 christos Exp $      */
+/*     $NetBSD: cmds.c,v 1.136 2016/02/06 21:23:09 christos Exp $      */
 
 /*-
  * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
 #if 0
 static char sccsid[] = "@(#)cmds.c     8.6 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: cmds.c,v 1.135 2012/12/22 16:57:09 christos Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.136 2016/02/06 21:23:09 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -1967,15 +1967,15 @@
        char *cp2 = dst;
        size_t i, ostop;
 
-       for (ostop = 0; *(ntout + ostop) && ostop < 16; ostop++)
+       for (ostop = 0; ntout[ostop] && ostop < sizeof(ntout); ostop++)
                continue;
        for (cp1 = src; *cp1; cp1++) {
                int found = 0;
-               for (i = 0; *(ntin + i) && i < 16; i++) {
-                       if (*cp1 == *(ntin + i)) {
+               for (i = 0; ntin[i] && i < sizeof(ntin); i++) {
+                       if (*cp1 == ntin[i]) {
                                found++;
                                if (i < ostop) {
-                                       *cp2++ = *(ntout + i);
+                                       *cp2++ = ntout[i];
                                        if (cp2 - dst >= (ptrdiff_t)(dlen - 1))
                                                goto out;
                                }



Home | Main Index | Thread Index | Old Index