This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/713] New: fgets() should only return zero upon error or EOF
- From: "bww at acm dot org" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 10 Feb 2005 21:04:45 -0000
- Subject: [Bug libc/713] New: fgets() should only return zero upon error or EOF
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
/*
* fgets() should only return zero upon error or EOF
* (and not having enough space to store all available
* input is not an error).
*
* For example under Fedora Core release 3 ...
* % gcc -static c.c -o c
* % echo | ./c
* ERROR
*
* whereas under Solaris 5.8 ...
* % gcc -static c.c -o c
* % echo | ./c
* OK
*/
#include <stdio.h>
int
main()
{
char buf[1];
char *bp;
bp = fgets(buf, sizeof buf, stdin);
printf("%s\n", (bp == buf) ? "OK" : "ERROR");
return 0;
}
--
Summary: fgets() should only return zero upon error or EOF
Product: glibc
Version: 2.3.4
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: gotom at debian dot or dot jp
ReportedBy: bww at acm dot org
CC: glibc-bugs at sources dot redhat dot com
http://sources.redhat.com/bugzilla/show_bug.cgi?id=713
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.