Fix parse_size

rm-left-on-dead
Vitaliy Filippov 2022-09-04 14:20:50 +03:00
parent 8972878c77
commit 9ccc607ab9
1 changed files with 2 additions and 5 deletions

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;
}