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