libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 51e9b51e26b405c1f30a6b4773e7565d9ffed0eb
parent ce0e99c545b19b5bdf9de5dd77984c04ede1f45c
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat, 20 Dec 2014 00:40:16 +0000

-check fgetc rval even if feof said it wouldn't be EOF

Diffstat:
Msrc/testspdy/test_proxies.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/testspdy/test_proxies.c b/src/testspdy/test_proxies.c @@ -183,6 +183,7 @@ int main() pid_t devnull; char *cmd; unsigned int i; + int retc; char buf[strlen(EXPECTED_BODY) + 1]; close(1); @@ -202,7 +203,10 @@ int main() { for (i = 0; i < strlen(EXPECTED_BODY) && !feof(p); i++) { - buf[i] = fgetc(p); + retc = fgetc (p); + if (EOF == retc) + abort (); /* what did feof(p) do there!? */ + buf[i] = (char) retc; } pclose(p);