diff --git a/src/Main/XLIFFParser.cxx b/src/Main/XLIFFParser.cxx index 9e4ede4e8..4cbb1e49e 100644 --- a/src/Main/XLIFFParser.cxx +++ b/src/Main/XLIFFParser.cxx @@ -56,11 +56,11 @@ void XLIFFParser::startElement(const char *name, const XMLAttributes &atts) _source.clear(); _target.clear(); - std::string as = atts.getValue("approved"); - if (as.empty()) { + const char* ac = atts.getValue("approved"); + if (!ac || !strcmp(ac, "")) { _approved = false; } else { - _approved = simgear::strutils::to_bool(as); + _approved = simgear::strutils::to_bool(std::string{ac}); } } else if (tag == "group") { _resource = atts.getValue("resname");