diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-10-17 16:10:53 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-10-17 23:11:18 +0000 |
commit | 033f096ee909b63c0692b80416797f743940d054 (patch) | |
tree | 0ec827ec1bfa5a7893c19e81f27d782797a66644 /epan/disabled_protos.c | |
parent | 344c2bbb5e2a23764fe21adeaf2439d267960a96 (diff) |
Don't use ctype.h routines.
That avoids locale dependency and handles possibly-signed chars (which
we weren't always doing before).
Change-Id: Ieceb93029252f646397b6488f2df8a57c6d2a23d
Reviewed-on: https://code.wireshark.org/review/4794
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/disabled_protos.c')
-rw-r--r-- | epan/disabled_protos.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/epan/disabled_protos.c b/epan/disabled_protos.c index 1ccaf72f2d..1afe9c96db 100644 --- a/epan/disabled_protos.c +++ b/epan/disabled_protos.c @@ -24,7 +24,6 @@ #include <stdio.h> #include <string.h> -#include <ctype.h> #include <errno.h> #ifdef HAVE_UNISTD_H @@ -179,7 +178,7 @@ read_disabled_protos_list_file(const char *ff_path, FILE *ff, a protocol to be disabled. */ /* Skip over leading white space, if any. */ - while ((c = getc(ff)) != EOF && isspace(c)) { + while ((c = getc(ff)) != EOF && g_ascii_isspace(c)) { if (c == '\n') { /* Blank line. */ continue; @@ -200,7 +199,7 @@ read_disabled_protos_list_file(const char *ff_path, FILE *ff, c = getc(ff); if (c == EOF) break; /* End of file, or I/O error */ - if (isspace(c)) + if (g_ascii_isspace(c)) break; /* Trailing white space, or end of line. */ if (c == '#') break; /* Start of comment, running to end of line. */ @@ -214,9 +213,9 @@ read_disabled_protos_list_file(const char *ff_path, FILE *ff, prot_name_index++; } - if (isspace(c) && c != '\n') { + if (g_ascii_isspace(c) && c != '\n') { /* Skip over trailing white space. */ - while ((c = getc(ff)) != EOF && c != '\n' && isspace(c)) + while ((c = getc(ff)) != EOF && c != '\n' && g_ascii_isspace(c)) ; if (c != EOF && c != '\n' && c != '#') { /* Non-white-space after the protocol name; warn about it, |