Geobuf testing exposes a bug in type coercion of 0.0 to boolean

This commit is contained in:
Eric Fischer
2017-08-29 11:43:39 -07:00
parent 7c031a9796
commit 4b66aa828d
5 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -622,7 +622,7 @@ void coerce_value(std::string const &key, int &vt, std::string &val, std::map<st
}
}
} else if (a->second == mvt_bool) {
if (val == "false" || val == "0" || val == "null" || val.size() == 0) {
if (val == "false" || val == "0" || val == "null" || val.size() == 0 || (vt == mvt_double && atof(val.c_str()) == 0)) {
vt = mvt_bool;
val = "false";
} else {