diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-20 00:40:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-20 00:40:16 +0000 |
commit | 51e9b51e26b405c1f30a6b4773e7565d9ffed0eb (patch) | |
tree | 90a4cac45b6bdc15c90f00feed5d1ffb1df91ce3 | |
parent | ce0e99c545b19b5bdf9de5dd77984c04ede1f45c (diff) | |
download | libmicrohttpd-51e9b51e26b405c1f30a6b4773e7565d9ffed0eb.tar.gz libmicrohttpd-51e9b51e26b405c1f30a6b4773e7565d9ffed0eb.zip |
-check fgetc rval even if feof said it wouldn't be EOF
-rw-r--r-- | src/testspdy/test_proxies.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/testspdy/test_proxies.c b/src/testspdy/test_proxies.c index 1f5e1146..d8bc8d84 100644 --- a/src/testspdy/test_proxies.c +++ b/src/testspdy/test_proxies.c | |||
@@ -183,6 +183,7 @@ int main() | |||
183 | pid_t devnull; | 183 | pid_t devnull; |
184 | char *cmd; | 184 | char *cmd; |
185 | unsigned int i; | 185 | unsigned int i; |
186 | int retc; | ||
186 | char buf[strlen(EXPECTED_BODY) + 1]; | 187 | char buf[strlen(EXPECTED_BODY) + 1]; |
187 | 188 | ||
188 | close(1); | 189 | close(1); |
@@ -202,7 +203,10 @@ int main() | |||
202 | { | 203 | { |
203 | for (i = 0; i < strlen(EXPECTED_BODY) && !feof(p); i++) | 204 | for (i = 0; i < strlen(EXPECTED_BODY) && !feof(p); i++) |
204 | { | 205 | { |
205 | buf[i] = fgetc(p); | 206 | retc = fgetc (p); |
207 | if (EOF == retc) | ||
208 | abort (); /* what did feof(p) do there!? */ | ||
209 | buf[i] = (char) retc; | ||
206 | } | 210 | } |
207 | 211 | ||
208 | pclose(p); | 212 | pclose(p); |