Remove use of feof and ferror as it is not needed as the return of fgetc

is sufficent.
This commit is contained in:
Patrick Pelissier committed 2017-08-19 21:05:55 +02:00
1 parent 7ddb7e63b7
commit 44cdfa0c77
8 files changed
+21 -21

No files matched your search

+2 -2
View File
@@ -510,7 +510,7 @@ bitset_in_str(bitset_t set, FILE *file)
BITSETI_CONTRACT (set);
assert(file != NULL);
bitset_clean(set);
char c = fgetc(file);
int c = fgetc(file);
if (c != '[') return false;
c = fgetc(file);
do {
@@ -518,7 +518,7 @@ bitset_in_str(bitset_t set, FILE *file)
const bool b = (c == '1');
bitset_push_back (set, b);
c = fgetc(file);
} while (c != ']' && !feof(file) && !ferror(file));
} while (c != ']' && c != EOF);
BITSETI_CONTRACT (set);
return c == ']';
}