diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-10-19 23:14:50 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-10-20 06:15:19 +0000 |
commit | 80e6f6251e96dd7b8a9ab0fdbf63b03a73ef6692 (patch) | |
tree | 92d519b9b19cccba0d083a6ad20152352daa5924 /epan/dissectors/packet-smb-pipe.c | |
parent | 0b9eb9f4b71b6632cfb4b87bcdefdfa75eaf2dd0 (diff) |
Get rid of calls to ctype.h functions.
They don't handle values outside the range -1 to 127, and their behavior
is locale-dependent. Use g_ascii_isXXX() and g_ascii_toXXX() instead of
isXXX() and toXXX().
If you're checking for printable ASCII, don't use isascii() and don't
use iscntrl(), use g_ascii_isprint(). If you're checking for graphical
ASCII, i.e. printable ASCII except for a space, use g_ascii_isgraph().
Use ws_xton() to convert a hex digit character to the corresponding
numeric value.
Change-Id: Id3039bc586fbf66d8736c2df248c790c0d7a2330
Reviewed-on: https://code.wireshark.org/review/4851
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-smb-pipe.c')
-rw-r--r-- | epan/dissectors/packet-smb-pipe.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/epan/dissectors/packet-smb-pipe.c b/epan/dissectors/packet-smb-pipe.c index e34003ee07..e6762a8d80 100644 --- a/epan/dissectors/packet-smb-pipe.c +++ b/epan/dissectors/packet-smb-pipe.c @@ -34,7 +34,6 @@ XXX Fixme : shouldn't show [malformed frame] for long packets #include <time.h> #include <string.h> #include <glib.h> -#include <ctype.h> #include <epan/packet.h> #include <epan/exceptions.h> @@ -1596,12 +1595,12 @@ get_count(const guchar *desc, int *countp) int count = 0; guchar c; - if (!isdigit(*desc)) { + if (!g_ascii_isdigit(*desc)) { *countp = 1; /* no count was supplied */ return desc; } - while ((c = *desc) != '\0' && isdigit(c)) { + while ((c = *desc) != '\0' && g_ascii_isdigit(c)) { count = (count * 10) + c - '0'; desc++; } |