BTG reading: don’t crash on empty error message

Sentry-Id:FLIGHTGEAR-WA8
This commit is contained in:
James Turner
2021-07-15 08:43:31 +01:00
parent a9dddbcddc
commit cde75530fe

View File

@@ -48,9 +48,11 @@ static std::string gzErrorMessage(gzFile fd)
if (errNum == Z_ERRNO) {
return simgear::strutils::error_string(errno);
} else {
} else if (gzMsg) {
return {gzMsg};
}
return {"GZError: no string code for code:" + std::to_string(errNum)};
}
void sgReadChar ( gzFile fd, char *var )