Diff between df658c6c4ab5bd5ec4a8a3f8faa36e0d0a5f906a and 53542db3d6c6bc9991e3f9b0ab05e6ea6cee753d

Changed Files

File Additions Deletions Status
src/main.c +7 -5 modified

Full Patch

diff --git a/src/main.c b/src/main.c
index b5a6f8e..cddf139 100644
--- a/src/main.c
+++ b/src/main.c
@@ -440,9 +440,9 @@ static bool parse_config_string(GKeyFile *config, const char *group,
 
 static bool parse_config_int(GKeyFile *config, const char *group,
 					const char *key, int *val,
-					int min, int max)
+					size_t min, size_t max)
 {
-	int tmp;
+	size_t tmp;
 	char *str = NULL;
 	char *endptr = NULL;
 
@@ -456,12 +456,14 @@ static bool parse_config_int(GKeyFile *config, const char *group,
 	}
 
 	if (tmp < min) {
-		warn("%s.%s = %d is out of range (< %d)", group, key, tmp, min);
+		warn("%s.%s = %zu is out of range (< %zu)", group, key, tmp,
+									min);
 		return false;
 	}
 
 	if (tmp > max) {
-		warn("%s.%s = %d is out of range (> %d)", group, key, tmp, max);
+		warn("%s.%s = %zu is out of range (> %zu)", group, key, tmp,
+									max);
 		return false;
 	}
 
@@ -774,7 +776,7 @@ static bool parse_config_u32(GKeyFile *config, const char *group,
 {
 	int tmp;
 
-	if (!parse_config_int(config, group, key, &tmp, 0, UINT32_MAX))
+	if (!parse_config_int(config, group, key, &tmp, min, max))
 		return false;
 
 	if (val)