Fix parse_size

This commit is contained in:
Vitaliy Filippov
2022-09-04 14:20:56 +03:00
parent 8972878c77
commit 9ccc607ab9
+2 -5
View File
@@ -130,11 +130,8 @@ uint64_t parse_size(std::string size_str, bool *ok)
size_str = size_str.substr(0, size_str.length()-1);
}
uint64_t size = stoull_full(size_str, 0) * mul;
if (size == 0 && size_str != "0" && (size_str != "" || mul != 1))
{
if (ok)
*ok = false;
}
if (ok)
*ok = !(size == 0 && size_str != "0" && (size_str != "" || mul != 1));
return size;
}