From 15eb607c1c0803812050a50fc7dcfb9f456ff3b2 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 22 Sep 1999 04:30:11 +0000 Subject: 19990922 git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 3aa95e2ca..c1c7d511d 100644 --- a/io.c +++ b/io.c @@ -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)); } -- cgit