fix invariant result 62/139462/6
authorSooChan Lim <sc1.lim@samsung.com>
Wed, 19 Jul 2017 05:01:24 +0000 (14:01 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 19 Jul 2017 06:00:23 +0000 (06:00 +0000)
Change-Id: I4b4b929f69cbaa192ebde05c81dacf027543cb66

src/tbm_drm_helper_client.c
src/tbm_drm_helper_server.c

index 7980e1e..95814be 100644 (file)
@@ -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 {
index c96d6a7..a440175 100644 (file)
@@ -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 {