]> git.mxchange.org Git - flightgear.git/commit
apt.dat parser: better input stream handling
authorFlorent Rougon <f.rougon@free.fr>
Sun, 24 Apr 2016 17:33:41 +0000 (19:33 +0200)
committerFlorent Rougon <f.rougon@free.fr>
Wed, 27 Apr 2016 08:39:21 +0000 (10:39 +0200)
commitb0b81bcd3e633dee63fa3f87543bb830e6281486
treedfa765f018a62e2fb228ee6676f3899e44609d34
parentd6f0bc6fb5132d4645682e8577a543fca47efbf6
apt.dat parser: better input stream handling

- use ( in.getline(...) ) as the main loop condition instead of
  ( ! in.eof() ). This should behave better (see
  <https://gehrcke.de/2011/06/reading-files-in-c-using-ifstream-dealing-correctly-with-badbit-failbit-eofbit-and-perror/>);
- check in.bad() after exiting from each reading loop; if the exit was
  caused by an error, log an appropriate message and throw an
  exception.
src/Airports/apt_loader.cxx