mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-29 22:38:40 +00:00
BUILD: log: fix build warning on Solaris
The is* macros must not use a char on Solaris. Unsigned char is OK. Casting char to int is wrong as well since we get a negative value. src/log.c: In function `parse_logformat_string': src/log.c:454: warning: subscript has type `char'
This commit is contained in:
parent
668ae532b9
commit
0f28f82cec
@ -445,13 +445,13 @@ void parse_logformat_string(const char *fmt, struct proxy *curproxy, struct list
|
|||||||
cformat = LF_STEXPR;
|
cformat = LF_STEXPR;
|
||||||
var = str + 1; // store expr in variable name
|
var = str + 1; // store expr in variable name
|
||||||
}
|
}
|
||||||
else if (isalpha((int)*str)) { // variable name
|
else if (isalpha((unsigned char)*str)) { // variable name
|
||||||
cformat = LF_VAR;
|
cformat = LF_VAR;
|
||||||
var = str;
|
var = str;
|
||||||
}
|
}
|
||||||
else if (*str == '%')
|
else if (*str == '%')
|
||||||
cformat = LF_TEXT; // convert this character to a litteral (useful for '%')
|
cformat = LF_TEXT; // convert this character to a litteral (useful for '%')
|
||||||
else if (isdigit(*str) || *str == ' ' || *str == '\t') {
|
else if (isdigit((unsigned char)*str) || *str == ' ' || *str == '\t') {
|
||||||
/* single '%' followed by blank or digit, send them both */
|
/* single '%' followed by blank or digit, send them both */
|
||||||
cformat = LF_TEXT;
|
cformat = LF_TEXT;
|
||||||
pformat = LF_TEXT; /* finally we include the previous char as well */
|
pformat = LF_TEXT; /* finally we include the previous char as well */
|
||||||
@ -478,7 +478,7 @@ void parse_logformat_string(const char *fmt, struct proxy *curproxy, struct list
|
|||||||
var = str + 1; // store expr in variable name
|
var = str + 1; // store expr in variable name
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (isalnum((int)*str)) { // variable name
|
else if (isalnum((unsigned char)*str)) { // variable name
|
||||||
cformat = LF_VAR;
|
cformat = LF_VAR;
|
||||||
var = str;
|
var = str;
|
||||||
break;
|
break;
|
||||||
@ -498,7 +498,7 @@ void parse_logformat_string(const char *fmt, struct proxy *curproxy, struct list
|
|||||||
|
|
||||||
case LF_VAR: // text part of a variable name
|
case LF_VAR: // text part of a variable name
|
||||||
var_len = str - var;
|
var_len = str - var;
|
||||||
if (!isalnum((int)*str))
|
if (!isalnum((unsigned char)*str))
|
||||||
cformat = LF_INIT; // not variable name anymore
|
cformat = LF_INIT; // not variable name anymore
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user