summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorMohammed Azhar Padariyakam <mpadariy@redhat.com>2017-09-21 18:12:59 +0530
committerJeff Darcy <jeff@pl.atyp.us>2017-09-29 16:31:27 +0000
commit306164fb4121e814b61e9b5685319f889f6b7547 (patch)
tree00db6fe7b7a408c405009e5df06b6fe1c261c653 /libglusterfs
parent8154e044e1b920b10d632d8c1e6d36007927b267 (diff)
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 <mpadariy@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/common-utils.c9
1 files 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