From 306164fb4121e814b61e9b5685319f889f6b7547 Mon Sep 17 00:00:00 2001 From: Mohammed Azhar Padariyakam Date: Thu, 21 Sep 2017 18:12:59 +0530 Subject: libglusterfs: Coverity Fix CONSTANT_EXPRESSION_RESULT in gf_string2int64 Issue : "l <= 9223372036854775807L" is always true regardless of the values of its operands. This occurs as the logical operand of "if". Solution : Remove the comparison which always turns out to be true Fix : The if-condition was removed and the body inside the same was retained. Change-Id: Iba94d7f4f2dee85a180d10cdb7f7235b406cc400 BUG: 789278 Signed-off-by: Mohammed Azhar Padariyakam --- libglusterfs/src/common-utils.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index c90856cca33..3da01a4d117 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -1393,13 +1393,8 @@ gf_string2int64 (const char *str, int64_t *n) if (rv != 0) return rv; - if (l <= INT64_MAX) { - *n = (int64_t) l; - return 0; - } - - errno = ERANGE; - return -1; + *n = (int64_t) l; + return 0; } int -- cgit