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;
} 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 {
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;
} 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 {