diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2014-10-04 14:27:08 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2014-10-04 14:28:26 -0700 |
commit | d7b3821c0aa6402a89dd10f1e47e58524a8fe977 (patch) | |
tree | 271240391f7edb9d94affb9f33504017f6a6218d /fish_indent.cpp | |
parent | 1665f84d60ea136dfe581513310b68d36a6d1a8b (diff) |
Use ferror instead of checking errno to detect errors in read_file
glibc sets errno even though the file read did not have an error
Fixes #1731
Diffstat (limited to 'fish_indent.cpp')
-rw-r--r-- | fish_indent.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fish_indent.cpp b/fish_indent.cpp index 1332db5e..21ffd47f 100644 --- a/fish_indent.cpp +++ b/fish_indent.cpp @@ -54,11 +54,10 @@ static void read_file(FILE *f, wcstring &b) { while (1) { - errno=0; wint_t c = fgetwc(f); if (c == WEOF) { - if (errno) + if (ferror(f)) { wperror(L"fgetwc"); exit(1); |