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:
Guy Harris 2007-07-14 00:37:01 +00:00
parent 90ab61d9f7
commit fad7133f81
4 changed files with 12 additions and 12 deletions

View File

@ -221,7 +221,7 @@ gchar* dfilter_macro_apply(const gchar* text, guint depth, const gchar** error)
}
break;
} case NAME: {
if ( isalnum((int)c) || c == '_' ) {
if ( isalnum((guchar)c) || c == '_' ) {
g_string_append_c(name,c);
} else if ( c == ':') {
state = ARGS;
@ -452,7 +452,7 @@ static gboolean macro_name_chk(void* r _U_, const char* in_name, unsigned name_l
guint 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";
return FALSE;
}

View File

@ -553,15 +553,15 @@ hex_str_to_bytes(const char *hex_str, GByteArray *bytes, gboolean force_separato
gboolean
uri_str_to_bytes(const char *uri_str, GByteArray *bytes) {
guint8 val;
const char *p;
char hex_digit[HEX_DIGIT_BUF_LEN];
const guchar *p;
guchar hex_digit[HEX_DIGIT_BUF_LEN];
g_byte_array_set_size(bytes, 0);
if (! uri_str) {
return FALSE;
}
p = uri_str;
p = (const guchar *)uri_str;
while (*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;
hex_digit[1] = *p;
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;
val = (guint8) strtoul(hex_digit, NULL, 16);
val = (guint8) strtoul((char *)hex_digit, NULL, 16);
g_byte_array_append(bytes, &val, 1);
} else {
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;
dot = NULL;
while (*p) {
if (!isdigit((int)*p) && (*p != '.')) return FALSE;
if (!isdigit((guchar)*p) && (*p != '.')) return FALSE;
if (*p == '.') {
if (p == oid_str) 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 */
while (*p) {
subid = 0;
while (isdigit((int)*p)) {
while (isdigit((guchar)*p)) {
subid *= 10;
subid += *p - '0';
p++;

View File

@ -186,7 +186,7 @@ static void putfld(FILE* fp, void* rec, uat_field_t* f) {
for(i=0;i<fld_len;i++) {
char c = fld_ptr[i];
if (c == '"' || c == '\\' || ! isprint((int)c) ) {
if (c == '"' || c == '\\' || ! isprint((guchar)c) ) {
fprintf(fp,"\\x%.2x",c);
} else {
putc(c,fp);
@ -513,7 +513,7 @@ char* uat_unesc(const char* si, guint in_len, guint* len_p) {
char c1 = *(s+1);
char c0 = *(s+2);
if (isxdigit((int)c1) && isxdigit((int)c0)) {
if (isxdigit((guchar)c1) && isxdigit((guchar)c0)) {
*(p++) = (xton(c1) * 0x10) + xton(c0);
s += 2;
} else {

View File

@ -111,7 +111,7 @@ fileset_filename_match_pattern(const char *fname)
while(minlen--) {
baselen--;
if(!isdigit( (int) filename[baselen])) {
if(!isdigit( (guchar) filename[baselen])) {
g_free(filename);
return FALSE;
}