From: lu.shasha Date: Fri, 27 Oct 2017 02:14:14 +0000 (+0800) Subject: common: strict_strtol INT_MAX and INT_MIN is valid X-Git-Tag: v13.0.1~360^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F18574%2Fhead;p=ceph.git common: strict_strtol INT_MAX and INT_MIN is valid Signed-off-by: Shasha Lu --- diff --git a/src/common/strtol.cc b/src/common/strtol.cc index 4997a1242af1..5721b63fb41d 100644 --- a/src/common/strtol.cc +++ b/src/common/strtol.cc @@ -61,7 +61,7 @@ int strict_strtol(const char *str, int base, std::string *err) long long ret = strict_strtoll(str, base, err); if (!err->empty()) return 0; - if ((ret <= INT_MIN) || (ret >= INT_MAX)) { + if ((ret < INT_MIN) || (ret > INT_MAX)) { errStr = "The option value '"; errStr.append(str); errStr.append("'");