aboutsummaryrefslogtreecommitdiff
path: root/tools/regression
diff options
context:
space:
mode:
authorDavid Schultz <das@FreeBSD.org>2009-04-06 13:50:04 +0000
committerDavid Schultz <das@FreeBSD.org>2009-04-06 13:50:04 +0000
commit6685ac34d91d361a03918777934cf037bedd8841 (patch)
tree55b9d467c4c819ca6310500170877ae242edc70b /tools/regression
parentecac0338c16295ef854e41935920aacf5af8d867 (diff)
downloadsrc-6685ac34d91d361a03918777934cf037bedd8841.tar.gz
src-6685ac34d91d361a03918777934cf037bedd8841.zip
Return -1 instead of 0 upon reaching EOF. This is somewhat ill-advised
because it means getdelim() returns -1 for both error and EOF, and never returns 0. However, this is what the original GNU implementation does, and POSIX inherited the bug. Reported by: marcus@
Notes
Notes: svn path=/head/; revision=190773
Diffstat (limited to 'tools/regression')
-rw-r--r--tools/regression/lib/libc/stdio/test-getdelim.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/regression/lib/libc/stdio/test-getdelim.c b/tools/regression/lib/libc/stdio/test-getdelim.c
index 3488d63b6bee..1102c20fd5af 100644
--- a/tools/regression/lib/libc/stdio/test-getdelim.c
+++ b/tools/regression/lib/libc/stdio/test-getdelim.c
@@ -100,7 +100,7 @@ main(int argc, char *argv[])
assert(line[0] == '\0' && line[1] == '\0');
/* Third line: EOF */
line[0] = 'X';
- assert(getline(&line, &linecap, fp) == 0);
+ assert(getline(&line, &linecap, fp) == -1);
assert(line[0] == '\0');
free(line);
assert(feof(fp));
@@ -139,7 +139,7 @@ main(int argc, char *argv[])
free(line);
line = NULL;
linecap = 0;
- assert(getline(&line, &linecap, fp) == 0);
+ assert(getline(&line, &linecap, fp) == -1);
assert(line[0] == '\0');
assert(linecap > 0);
assert(errno == 0);