Fix BTG error reporting

Use gzerror, not strerror, for these codes.
This commit is contained in:
James Turner 2020-12-18 09:44:22 +00:00
parent 68caf780b0
commit 284667c18f

View File

@ -566,8 +566,10 @@ bool SGBinObject::read_bin( const SGPath& file ) {
sgReadUInt( fp, &header ); sgReadUInt( fp, &header );
if (sgReadError()) { if (sgReadError()) {
int code = 0;
const char* gzErrorString = gzerror(fp, &code);
gzclose(fp); gzclose(fp);
throw sg_io_exception("Unable to read BTG header: " + simgear::strutils::error_string(errno), sg_location(file)); throw sg_io_exception("Unable to read BTG header: " + string{gzErrorString} + ", code =" + std::to_string(code), sg_location(file));
} }
if ( ((header & 0xFF000000) >> 24) == 'S' && if ( ((header & 0xFF000000) >> 24) == 'S' &&