Fix yet more casts of ctype.h macro arguments - and fix some cases where
we were passing an uncasted "char" to those macros. svn path=/trunk/; revision=22306
This commit is contained in:
parent
90ab61d9f7
commit
fad7133f81
|
@ -221,7 +221,7 @@ gchar* dfilter_macro_apply(const gchar* text, guint depth, const gchar** error)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} case NAME: {
|
} case NAME: {
|
||||||
if ( isalnum((int)c) || c == '_' ) {
|
if ( isalnum((guchar)c) || c == '_' ) {
|
||||||
g_string_append_c(name,c);
|
g_string_append_c(name,c);
|
||||||
} else if ( c == ':') {
|
} else if ( c == ':') {
|
||||||
state = ARGS;
|
state = ARGS;
|
||||||
|
@ -452,7 +452,7 @@ static gboolean macro_name_chk(void* r _U_, const char* in_name, unsigned name_l
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
for (i=0; i < name_len; i++) {
|
for (i=0; i < name_len; i++) {
|
||||||
if (!(in_name[i] == '_' || isalnum((int)in_name[i]) ) ) {
|
if (!(in_name[i] == '_' || isalnum((guchar)in_name[i]) ) ) {
|
||||||
*error = "invalid char in name";
|
*error = "invalid char in name";
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -553,15 +553,15 @@ hex_str_to_bytes(const char *hex_str, GByteArray *bytes, gboolean force_separato
|
||||||
gboolean
|
gboolean
|
||||||
uri_str_to_bytes(const char *uri_str, GByteArray *bytes) {
|
uri_str_to_bytes(const char *uri_str, GByteArray *bytes) {
|
||||||
guint8 val;
|
guint8 val;
|
||||||
const char *p;
|
const guchar *p;
|
||||||
char hex_digit[HEX_DIGIT_BUF_LEN];
|
guchar hex_digit[HEX_DIGIT_BUF_LEN];
|
||||||
|
|
||||||
g_byte_array_set_size(bytes, 0);
|
g_byte_array_set_size(bytes, 0);
|
||||||
if (! uri_str) {
|
if (! uri_str) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = uri_str;
|
p = (const guchar *)uri_str;
|
||||||
|
|
||||||
while (*p) {
|
while (*p) {
|
||||||
if (! isascii(*p) || ! isprint(*p))
|
if (! isascii(*p) || ! isprint(*p))
|
||||||
|
@ -574,9 +574,9 @@ uri_str_to_bytes(const char *uri_str, GByteArray *bytes) {
|
||||||
if (*p == '\0') return FALSE;
|
if (*p == '\0') return FALSE;
|
||||||
hex_digit[1] = *p;
|
hex_digit[1] = *p;
|
||||||
hex_digit[2] = '\0';
|
hex_digit[2] = '\0';
|
||||||
if (! isxdigit((int)hex_digit[0]) || ! isxdigit((int)hex_digit[1]))
|
if (! isxdigit(hex_digit[0]) || ! isxdigit(hex_digit[1]))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
val = (guint8) strtoul(hex_digit, NULL, 16);
|
val = (guint8) strtoul((char *)hex_digit, NULL, 16);
|
||||||
g_byte_array_append(bytes, &val, 1);
|
g_byte_array_append(bytes, &val, 1);
|
||||||
} else {
|
} else {
|
||||||
g_byte_array_append(bytes, (guint8 *) p, 1);
|
g_byte_array_append(bytes, (guint8 *) p, 1);
|
||||||
|
@ -691,7 +691,7 @@ oid_str_to_bytes(const char *oid_str, GByteArray *bytes) {
|
||||||
p = oid_str;
|
p = oid_str;
|
||||||
dot = NULL;
|
dot = NULL;
|
||||||
while (*p) {
|
while (*p) {
|
||||||
if (!isdigit((int)*p) && (*p != '.')) return FALSE;
|
if (!isdigit((guchar)*p) && (*p != '.')) return FALSE;
|
||||||
if (*p == '.') {
|
if (*p == '.') {
|
||||||
if (p == oid_str) return FALSE;
|
if (p == oid_str) return FALSE;
|
||||||
if (!*(p+1)) return FALSE;
|
if (!*(p+1)) return FALSE;
|
||||||
|
@ -707,7 +707,7 @@ oid_str_to_bytes(const char *oid_str, GByteArray *bytes) {
|
||||||
subid0 = 0; /* squelch GCC complaints */
|
subid0 = 0; /* squelch GCC complaints */
|
||||||
while (*p) {
|
while (*p) {
|
||||||
subid = 0;
|
subid = 0;
|
||||||
while (isdigit((int)*p)) {
|
while (isdigit((guchar)*p)) {
|
||||||
subid *= 10;
|
subid *= 10;
|
||||||
subid += *p - '0';
|
subid += *p - '0';
|
||||||
p++;
|
p++;
|
||||||
|
|
|
@ -186,7 +186,7 @@ static void putfld(FILE* fp, void* rec, uat_field_t* f) {
|
||||||
for(i=0;i<fld_len;i++) {
|
for(i=0;i<fld_len;i++) {
|
||||||
char c = fld_ptr[i];
|
char c = fld_ptr[i];
|
||||||
|
|
||||||
if (c == '"' || c == '\\' || ! isprint((int)c) ) {
|
if (c == '"' || c == '\\' || ! isprint((guchar)c) ) {
|
||||||
fprintf(fp,"\\x%.2x",c);
|
fprintf(fp,"\\x%.2x",c);
|
||||||
} else {
|
} else {
|
||||||
putc(c,fp);
|
putc(c,fp);
|
||||||
|
@ -513,7 +513,7 @@ char* uat_unesc(const char* si, guint in_len, guint* len_p) {
|
||||||
char c1 = *(s+1);
|
char c1 = *(s+1);
|
||||||
char c0 = *(s+2);
|
char c0 = *(s+2);
|
||||||
|
|
||||||
if (isxdigit((int)c1) && isxdigit((int)c0)) {
|
if (isxdigit((guchar)c1) && isxdigit((guchar)c0)) {
|
||||||
*(p++) = (xton(c1) * 0x10) + xton(c0);
|
*(p++) = (xton(c1) * 0x10) + xton(c0);
|
||||||
s += 2;
|
s += 2;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -111,7 +111,7 @@ fileset_filename_match_pattern(const char *fname)
|
||||||
while(minlen--) {
|
while(minlen--) {
|
||||||
baselen--;
|
baselen--;
|
||||||
|
|
||||||
if(!isdigit( (int) filename[baselen])) {
|
if(!isdigit( (guchar) filename[baselen])) {
|
||||||
g_free(filename);
|
g_free(filename);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue