From 9af4e72354e3c50b9d35081875e5074fbf329003 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Wed, 19 Jul 2017 14:06:34 +0900 Subject: [PATCH] fix invariant result Change-Id: Iecb805dfda52036b6bf9a37bb9af994dbe2979d8 --- src/tdm_helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tdm_helper.c b/src/tdm_helper.c index aaf7fbd..712a9da 100644 --- a/src/tdm_helper.c +++ b/src/tdm_helper.c @@ -548,7 +548,7 @@ tdm_helper_get_fd(const char *env) if (!value) return -1; - const long sl = strtol(value, &end, 10); + const long int sl = strtol(value, &end, 10); if (end == value) { TDM_ERR("%s: not a decimal number\n", value); return -1; @@ -558,10 +558,10 @@ tdm_helper_get_fd(const char *env) } else if ((sl == LONG_MIN || sl == LONG_MAX) && errno == ERANGE) { TDM_ERR("%s out of range of type long\n", value); return -1; - } else if (sl > INT_MAX) { + } else if (sl >= INT_MAX) { TDM_ERR("%ld greater than INT_MAX\n", sl); return -1; - } else if (sl < INT_MIN) { + } else if (sl <= INT_MIN) { TDM_ERR("%ld less than INT_MIN\n", sl); return -1; } else { -- 2.7.4