Fix empty size syntax, use C version of simple-offsets in tests

This commit is contained in:
Vitaliy Filippov
2021-11-20 23:51:26 +03:00
parent cd21ff0b6a
commit eb7ad2c114
8 changed files with 41 additions and 76 deletions
+1 -1
View File
@@ -454,7 +454,7 @@ uint64_t parse_size(std::string size_str)
size_str = size_str.substr(0, size_str.length()-1);
}
uint64_t size = json11::Json(size_str).uint64_value() * mul;
if (size == 0 && size_str != "0")
if (size == 0 && size_str != "0" && (size_str != "" || mul != 1))
{
fprintf(stderr, "Invalid syntax for size: %s\n", size_str.c_str());
exit(1);