Browse Source

lib/srdb1: cast for signed comparison

Daniel-Constantin Mierla 7 years ago
parent
commit
989ea3d60a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/lib/srdb1/db_ut.c

+ 1 - 1
src/lib/srdb1/db_ut.c

@@ -113,7 +113,7 @@ int db_str2uint(const char* _s, unsigned int* _v)
 
 	tmp = strtoul(_s, &p, 10);
 	if ((tmp == ULONG_MAX && errno == ERANGE) ||
-				(tmp < INT_MIN) || (tmp > UINT_MAX)) {
+				((long)tmp < INT_MIN) || (tmp > UINT_MAX)) {
 		LM_ERR("Value out of range\n");
 		return -1;
 	}