diff options
author | David Crosby <dave@dafyddcrosby.com> | 2015-07-26 04:47:24 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2015-08-11 12:59:27 +0000 |
commit | c162b75317f93503eeab83caf86de6738c3220f4 (patch) | |
tree | d6c5098f3476a72450df3b94b7850c39da5977f5 | |
parent | Adjust len to size_t (diff) | |
download | w3m-c162b75317f93503eeab83caf86de6738c3220f4.tar.gz w3m-c162b75317f93503eeab83caf86de6738c3220f4.zip |
Use fgetc in while loops, use int instead of char
Diffstat (limited to '')
-rw-r--r-- | Str.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -530,11 +530,8 @@ Str Strfgets(FILE * f) { Str s = Strnew(); - char c; - while (1) { - c = fgetc(f); - if (feof(f) || ferror(f)) - break; + int c; + while ((c = fgetc(f)) != EOF) { Strcat_char(s, c); if (c == '\n') break; @@ -546,11 +543,8 @@ Str Strfgetall(FILE * f) { Str s = Strnew(); - char c; - while (1) { - c = fgetc(f); - if (feof(f) || ferror(f)) - break; + int c; + while ((c = fgetc(f)) != EOF) { Strcat_char(s, c); } return s; |