Merge pull request #6018 from afabri/PSP-check_open_close-GF
Unset fail bit and add assertions about the state of a stream
This commit is contained in:
@@ -190,12 +190,15 @@ bool read_OFF(std::istream& is,
|
||||
put(normal_map, pwn, normal); // normal_map[&pwn] = normal
|
||||
*output++ = pwn;
|
||||
pointsRead++;
|
||||
|
||||
}
|
||||
// ...or skip comment line
|
||||
}
|
||||
// Skip remaining lines
|
||||
}
|
||||
|
||||
if(is.eof()) {
|
||||
is.clear(is.rdstate() & ~std::ios_base::failbit); // set by getline
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -179,6 +179,9 @@ bool read_XYZ(std::istream& is,
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(is.eof()) {
|
||||
is.clear(is.rdstate() & ~std::ios_base::failbit); // set by getline
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user