# | Line 237 | Line 237 | output_stream(FILE *fp) | |
---|---|---|
237 | ||
238 | if (fp == NULL) | |
239 | return(0); | |
240 | < | fflush(stdout); /* assumes nothing in input buffer */ |
241 | < | while ((n = read(fileno(fp), buf, sizeof(buf))) > 0) |
240 | > | fflush(stdout); |
241 | > | while ((n = fread(buf, 1, sizeof(buf), fp)) > 0) |
242 | if (write(fileno(stdout), buf, n) != n) | |
243 | return(0); | |
244 | < | return(n >= 0); |
244 | > | return(!ferror(fp)); |
245 | } | |
246 | ||
247 | /* get next word from stream, leaving stream on EOL or start of next word */ |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |