From fa26d660fbb0b5f1087abfe6e73df6d0cd85c090 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Wed, 19 Jul 2017 14:01:24 +0900 Subject: [PATCH] fix invariant result Change-Id: I4b4b929f69cbaa192ebde05c81dacf027543cb66 --- src/tbm_drm_helper_client.c | 6 +++--- src/tbm_drm_helper_server.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tbm_drm_helper_client.c b/src/tbm_drm_helper_client.c index 7980e1e..95814be 100644 --- a/src/tbm_drm_helper_client.c +++ b/src/tbm_drm_helper_client.c @@ -230,7 +230,7 @@ tbm_drm_helper_get_fd(void) if (!value) return -1; - const long sl = strtol(value, &end, 10); + const long int sl = strtol(value, &end, 10); if (end == value) { TBM_LOG_E("%s: not a decimal number\n", value); return -1; @@ -240,10 +240,10 @@ tbm_drm_helper_get_fd(void) } else if ((sl == LONG_MIN || sl == LONG_MAX) && errno == ERANGE) { TBM_LOG_E("%s out of range of type long\n", value); return -1; - } else if (sl > INT_MAX) { + } else if (sl >= INT_MAX) { TBM_LOG_E("%ld greater than INT_MAX\n", sl); return -1; - } else if (sl < INT_MIN) { + } else if (sl <= INT_MIN) { TBM_LOG_E("%ld less than INT_MIN\n", sl); return -1; } else { diff --git a/src/tbm_drm_helper_server.c b/src/tbm_drm_helper_server.c index c96d6a7..a440175 100644 --- a/src/tbm_drm_helper_server.c +++ b/src/tbm_drm_helper_server.c @@ -308,7 +308,7 @@ tbm_drm_helper_get_master_fd(void) if (!value) return -1; - const long sl = strtol(value, &end, 10); + const long int sl = strtol(value, &end, 10); if (end == value) { TBM_LOG_E("%s: not a decimal number\n", value); return -1; @@ -318,10 +318,10 @@ tbm_drm_helper_get_master_fd(void) } else if ((sl == LONG_MIN || sl == LONG_MAX) && errno == ERANGE) { TBM_LOG_E("%s out of range of type long\n", value); return -1; - } else if (sl > INT_MAX) { + } else if (sl >= INT_MAX) { TBM_LOG_E("%ld greater than INT_MAX\n", sl); return -1; - } else if (sl < INT_MIN) { + } else if (sl <= INT_MIN) { TBM_LOG_E("%ld less than INT_MIN\n", sl); return -1; } else { -- 2.7.4