]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
And more casts.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 13 Oct 2014 08:46:08 +0000 (08:46 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 13 Oct 2014 08:46:08 +0000 (08:46 +0000)
git-svn-id: file:///svn/unbound/trunk@3243 be551aaa-1e26-0410-a405-d3ace91eadb9

util/config_file.c

index 4bc7c0332a2d2759df45053d65d7145bfe871875..1fb534625de2f967d477263e4895775b05a12fc9 100644 (file)
@@ -1153,11 +1153,11 @@ cfg_parse_memsize(const char* str, size_t* res)
        else if(len > 1 && str[len-1] == 'B') 
                len--;
        
-       if(len > 1 && tolower(str[len-1]) == 'g')
+       if(len > 1 && tolower((unsigned char)str[len-1]) == 'g')
                mult = 1024*1024*1024;
-       else if(len > 1 && tolower(str[len-1]) == 'm')
+       else if(len > 1 && tolower((unsigned char)str[len-1]) == 'm')
                mult = 1024*1024;
-       else if(len > 1 && tolower(str[len-1]) == 'k')
+       else if(len > 1 && tolower((unsigned char)str[len-1]) == 'k')
                mult = 1024;
        else if(len > 0 && isdigit((unsigned char)str[len-1]))
                mult = 1;
@@ -1322,7 +1322,7 @@ cfg_parse_local_zone(struct config_file* cfg, const char* val)
 
        /* parse it as: [zone_name] [between stuff] [zone_type] */
        name = val;
-       while(*name && isspace(*name))
+       while(*name && isspace((unsigned char)*name))
                name++;
        if(!*name) {
                log_err("syntax error: too short: %s", val);
@@ -1341,7 +1341,7 @@ cfg_parse_local_zone(struct config_file* cfg, const char* val)
        buf[name_end-name] = '\0';
 
        type = last_space_pos(name_end);
-       while(type && *type && isspace(*type))
+       while(type && *type && isspace((unsigned char)*type))
                type++;
        if(!type || !*type) {
                log_err("syntax error: expected zone type: %s", val);
@@ -1368,7 +1368,7 @@ char* cfg_ptr_reverse(char* str)
 
        /* parse it as: [IP] [between stuff] [name] */
        ip = str;
-       while(*ip && isspace(*ip))
+       while(*ip && isspace((unsigned char)*ip))
                ip++;
        if(!*ip) {
                log_err("syntax error: too short: %s", str);
@@ -1423,7 +1423,7 @@ char* cfg_ptr_reverse(char* str)
        }
 
        /* printed the reverse address, now the between goop and name on end */
-       while(*ip_end && isspace(*ip_end))
+       while(*ip_end && isspace((unsigned char)*ip_end))
                ip_end++;
        if(name>ip_end) {
                snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "%.*s",