diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-09-22 04:30:11 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-09-22 04:30:11 +0000 |
commit | 8aad024e3ac6524f8bc09d839a331f926eab30ec (patch) | |
tree | 826107ddf61a637dcb32d60f334bf56c27d72dc1 /io.c | |
parent | 70a444b0cc703a2fd3e05045cd1e36266221149e (diff) |
19990922
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -449,14 +449,15 @@ io_fread(ptr, len, f) FILE *f; { size_t n = len; + int c; while (n--) { - *ptr = getc(f); - if (*ptr == EOF) { + c = getc(f); + if (c == EOF) { *ptr = '\0'; break; } - ptr++; + *ptr++ = c; if (!READ_DATA_PENDING(f)) { rb_thread_wait_fd(fileno(f)); } |