Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libc/stdio look at my index finger



details:   https://anonhg.NetBSD.org/src/rev/69336f2bd57d
branches:  trunk
changeset: 784971:69336f2bd57d
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Feb 15 23:27:19 2013 +0000

description:
look at my index finger

diffstat:

 tests/lib/libc/stdio/t_popen.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (61 lines):

diff -r 5a56c9019f8b -r 69336f2bd57d tests/lib/libc/stdio/t_popen.c
--- a/tests/lib/libc/stdio/t_popen.c    Fri Feb 15 22:35:39 2013 +0000
+++ b/tests/lib/libc/stdio/t_popen.c    Fri Feb 15 23:27:19 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_popen.c,v 1.3 2011/07/13 11:17:03 jruoho Exp $ */
+/*     $NetBSD: t_popen.c,v 1.4 2013/02/15 23:27:19 christos Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #endif /* not lint */
 
 #ifndef lint
-__RCSID("$NetBSD: t_popen.c,v 1.3 2011/07/13 11:17:03 jruoho Exp $");
+__RCSID("$NetBSD: t_popen.c,v 1.4 2013/02/15 23:27:19 christos Exp $");
 #endif /* not lint */
 
 #include <atf-c.h>
@@ -73,7 +73,7 @@
 ATF_TC_BODY(popen_zeropad, tc)
 {
        char *buffer, command[MAXPATHLEN];
-       int index, in;
+       int idx, in;
        FILE *my_pipe;
 
        if ((buffer = malloc(BUFSIZE)) == NULL)
@@ -81,8 +81,8 @@
 
        srand ((unsigned int)time(NULL));
 
-       for (index = 0; index < BUFSIZE; index++)
-               buffer[index]=(char)rand();
+       for (idx = 0; idx < BUFSIZE; idx++)
+               buffer[idx]=(char)rand();
 
        (void)snprintf(command, sizeof(command), "%s >%s",
            _PATH_CAT, DATAFILE);
@@ -101,18 +101,18 @@
        if ((my_pipe = popen(command, "r")) == NULL)
                TEST_ERROR("popen read");
 
-       index = 0;
+       idx = 0;
        while ((in = fgetc(my_pipe)) != EOF)
-               if (index == BUFSIZE) {
+               if (idx == BUFSIZE) {
                        errno = EFBIG;
                        TEST_ERROR("read");
                }
-               else if ((char)in != buffer[index++]) {
+               else if ((char)in != buffer[idx++]) {
                        errno = EINVAL;
                        TEST_ERROR("read");
                }
 
-       if (index < BUFSIZE) {
+       if (idx < BUFSIZE) {
                errno = EIO;
                TEST_ERROR("read");
        }



Home | Main Index | Thread Index | Old Index