diff --git a/simgear/io/lowlevel.cxx b/simgear/io/lowlevel.cxx index 9ae5bb42..52852b57 100644 --- a/simgear/io/lowlevel.cxx +++ b/simgear/io/lowlevel.cxx @@ -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 )