Module Name: src
Committed By: christos
Date: Fri Feb 15 23:27:19 UTC 2013
Modified Files:
src/tests/lib/libc/stdio: t_popen.c
Log Message:
look at my index finger
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/stdio/t_popen.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libc/stdio/t_popen.c
diff -u src/tests/lib/libc/stdio/t_popen.c:1.3 src/tests/lib/libc/stdio/t_popen.c:1.4
--- src/tests/lib/libc/stdio/t_popen.c:1.3 Wed Jul 13 07:17:03 2011
+++ src/tests/lib/libc/stdio/t_popen.c Fri Feb 15 18:27:19 2013
@@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1999\
#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_HEAD(popen_zeropad, tc)
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 @@ ATF_TC_BODY(popen_zeropad, tc)
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 @@ ATF_TC_BODY(popen_zeropad, tc)
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");
}