Merge pull request #7100 from afabri/CORE-EOF-GF

CORE: Use istream.eof()
This commit is contained in:
Laurent Rineau 2022-12-14 10:39:50 +01:00
commit 2f2d73d195
1 changed files with 6 additions and 2 deletions

View File

@ -103,7 +103,7 @@ int skip_comment_line (std::istream & in) {
}
} while (c == ' ' || c == '\t' || c == '\n');
if (c == EOF)
if (in.eof())
core_io_error_handler("CoreIO::read_from_file()","unexpected end of file.");
in.putback(c);
@ -191,7 +191,11 @@ void read_base_number(std::istream& in, BigInt& m, long length, long maxBits) {
buffer = new char[size+2];
// read digits
for (int i=0; (i<size)&&((c=skip_backslash_new_line(in)) != EOF ); i++) {
for (int i=0; i<size; i++) {
c=skip_backslash_new_line(in);
if(in.eof()){
break;
}
if (c != ' ' && c != '\t' && c != '\n')
append_char(buffer, size, pos++, c);
}