Fix BTG error reporting
Use gzerror, not strerror, for these codes.
This commit is contained in:
parent
def2af2bdd
commit
bea88bb3a9
@ -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' &&
|
||||||
|
Loading…
Reference in New Issue
Block a user