1
0
Fork 0

XLIFF: fix null approved-attr handling

This commit is contained in:
James Turner 2018-10-13 08:42:05 +01:00
parent 53de09d151
commit dbb99ee550

View file

@ -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");