From 9ccc607ab932f9ede912bbefaf19151318458231 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 4 Sep 2022 14:20:50 +0300 Subject: [PATCH] Fix parse_size --- src/str_util.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/str_util.cpp b/src/str_util.cpp index abd8801f..0484ceea 100644 --- a/src/str_util.cpp +++ b/src/str_util.cpp @@ -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; }