diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-10-16 16:41:59 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-10-16 23:46:58 +0000 |
commit | e6fcff1eb62b581eb7fb3d7af1d2e38612a00b30 (patch) | |
tree | f3adeef1c209a6f9a38d92f4bff121cd946076ec /epan/dfilter | |
parent | f249589938de63bab963ebf56bcfda3ac9ed2503 (diff) |
Use g_ascii_isalnum() rather than isalnum().
That way, we don't have to worry about casting the argument (which, in
one place, was done wrong - casting to int preserves the sign-extension
done with signed chars), and don't have to worry about a locale in which
particular 8-bit byte values are considered alphanumeric characters.
Change-Id: I129b4bfdad70ade4ab6e0a1d2c13d59ae9e6f524
Reviewed-on: https://code.wireshark.org/review/4751
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dfilter')
-rw-r--r-- | epan/dfilter/dfilter-macro.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/epan/dfilter/dfilter-macro.c b/epan/dfilter/dfilter-macro.c index caed065574..4a54e58a45 100644 --- a/epan/dfilter/dfilter-macro.c +++ b/epan/dfilter/dfilter-macro.c @@ -24,7 +24,6 @@ #include <stdio.h> #include <errno.h> -#include <ctype.h> #include <string.h> #include "dfilter-int.h" @@ -286,7 +285,7 @@ static const gchar* dfilter_macro_apply_recurse(const gchar* text, guint depth, } break; } case NAME: { - if ( isalnum((int)c) || c == '_' || c == '-' || c == '.' ) { + if ( g_ascii_isalnum(c) || c == '_' || c == '-' || c == '.' ) { g_string_append_c(name,c); } else if ( c == ':') { state = ARGS; @@ -586,7 +585,7 @@ static gboolean macro_name_chk(void* r _U_, const char* in_name, guint name_len, } for (i=0; i < name_len; i++) { - if (!(in_name[i] == '_' || isalnum((guchar)in_name[i]) ) ) { + if (!(in_name[i] == '_' || g_ascii_isalnum(in_name[i]) ) ) { *error = "invalid char in name"; return FALSE; } |