@@ -713,14 +713,14 @@ gf_trim(char *string)
713713        return  NULL ;
714714    }
715715
716-     for  (s  =  string ; isspace (* s ); s ++ )
716+     for  (s  =  string ; isspace (( unsigned  char ) * s ); s ++ )
717717        ;
718718
719719    if  (* s  ==  0 )
720720        return  s ;
721721
722722    t  =  s  +  strlen (s ) -  1 ;
723-     while  (t  >  s  &&  isspace (* t ))
723+     while  (t  >  s  &&  isspace (( unsigned  char ) * t ))
724724        t -- ;
725725    * ++ t  =  '\0' ;
726726
@@ -778,7 +778,7 @@ gf_string2time(const char *str, time_t *n)
778778    }
779779
780780    for  (s  =  str ; * s  !=  '\0' ; s ++ ) {
781-         if  (isspace (* s ))
781+         if  (isspace (( unsigned  char ) * s ))
782782            continue ;
783783        if  (* s  ==  '-' )
784784            return  -1 ;
@@ -852,7 +852,7 @@ gf_string2percent(const char *str, double *n)
852852    }
853853
854854    for  (s  =  str ; * s  !=  '\0' ; s ++ ) {
855-         if  (isspace (* s ))
855+         if  (isspace (( unsigned  char ) * s ))
856856            continue ;
857857        if  (* s  ==  '-' )
858858            return  -1 ;
@@ -928,7 +928,7 @@ _gf_string2ulong(const char *str, unsigned long *n, int base)
928928    }
929929
930930    for  (s  =  str ; * s  !=  '\0' ; s ++ ) {
931-         if  (isspace (* s ))
931+         if  (isspace (( unsigned  char ) * s ))
932932            continue ;
933933        if  (* s  ==  '-' )
934934            return  -1 ;
@@ -971,7 +971,7 @@ _gf_string2uint(const char *str, unsigned int *n, int base)
971971    }
972972
973973    for  (s  =  str ; * s  !=  '\0' ; s ++ ) {
974-         if  (isspace (* s ))
974+         if  (isspace (( unsigned  char ) * s ))
975975            continue ;
976976        if  (* s  ==  '-' )
977977            return  -1 ;
@@ -1082,7 +1082,7 @@ _gf_string2ulonglong(const char *str, unsigned long long *n, int base)
10821082    }
10831083
10841084    for  (s  =  str ; * s  !=  '\0' ; s ++ ) {
1085-         if  (isspace (* s ))
1085+         if  (isspace (( unsigned  char ) * s ))
10861086            continue ;
10871087        if  (* s  ==  '-' )
10881088            return  -1 ;
@@ -1450,7 +1450,7 @@ gf_string2bytesize_range(const char *str, uint64_t *n, uint64_t umax)
14501450    max  =  umax  &  0x7fffffffffffffffLL ;
14511451
14521452    for  (s  =  str ; * s  !=  '\0' ; s ++ ) {
1453-         if  (isspace (* s ))
1453+         if  (isspace (( unsigned  char ) * s ))
14541454            continue ;
14551455        if  (* s  ==  '-' )
14561456            return  -1 ;
@@ -1549,7 +1549,7 @@ gf_string2percent_or_bytesize(const char *str, double *n,
15491549    }
15501550
15511551    for  (s  =  str ; * s  !=  '\0' ; s ++ ) {
1552-         if  (isspace (* s ))
1552+         if  (isspace (( unsigned  char ) * s ))
15531553            continue ;
15541554        if  (* s  ==  '-' )
15551555            return  -1 ;
@@ -1806,7 +1806,7 @@ strtail(char *str, const char *pattern)
18061806void 
18071807skipwhite (char  * * s )
18081808{
1809-     while  (isspace (* * s ))
1809+     while  (isspace (( unsigned  char ) * * s ))
18101810        (* s )++ ;
18111811}
18121812
@@ -1995,7 +1995,8 @@ valid_host_name(char *address, int length)
19951995        goto out ;
19961996    }
19971997
1998-     if  (!isalnum (dup_addr [length  -  1 ]) &&  (dup_addr [length  -  1 ] !=  '*' )) {
1998+     if  (!isalnum ((unsigned char  )dup_addr [length  -  1 ]) && 
1999+         (dup_addr [length  -  1 ] !=  '*' )) {
19992000        ret  =  0 ;
20002001        goto out ;
20012002    }
@@ -2013,12 +2014,13 @@ valid_host_name(char *address, int length)
20132014    do  {
20142015        str_len  =  strlen (temp_str );
20152016
2016-         if  (!isalnum (temp_str [0 ]) ||  !isalnum (temp_str [str_len  -  1 ])) {
2017+         if  (!isalnum ((unsigned char  )temp_str [0 ]) || 
2018+             !isalnum ((unsigned char  )temp_str [str_len  -  1 ])) {
20172019            ret  =  0 ;
20182020            goto out ;
20192021        }
20202022        for  (i  =  1 ; i  <  str_len ; i ++ ) {
2021-             if  (!isalnum (temp_str [i ]) &&  (temp_str [i ] !=  '-' )) {
2023+             if  (!isalnum (( unsigned  char ) temp_str [i ]) &&  (temp_str [i ] !=  '-' )) {
20222024                ret  =  0 ;
20232025                goto out ;
20242026            }
@@ -2049,7 +2051,8 @@ valid_ipv4_address(char *address, int length, gf_boolean_t wildcard_acc)
20492051     * delimiters. 
20502052     */ 
20512053    if  (length  <= 0  ||  (strstr (address , ".." )) || 
2052-         (!isdigit (tmp [length  -  1 ]) &&  (tmp [length  -  1 ] !=  '*' ))) {
2054+         (!isdigit ((unsigned char  )tmp [length  -  1 ]) && 
2055+          (tmp [length  -  1 ] !=  '*' ))) {
20532056        ret  =  0 ;
20542057        goto out ;
20552058    }
0 commit comments