diff options
-rw-r--r-- | wiretap/catapult_dct2000.c | 27 | ||||
-rw-r--r-- | wiretap/cosine.c | 3 | ||||
-rw-r--r-- | wiretap/daintree-sna.c | 13 | ||||
-rw-r--r-- | wiretap/dbs-etherwatch.c | 19 | ||||
-rw-r--r-- | wiretap/dct3trace.c | 3 | ||||
-rw-r--r-- | wiretap/iseries.c | 5 | ||||
-rw-r--r-- | wiretap/netscreen.c | 5 | ||||
-rw-r--r-- | wiretap/vms.c | 11 |
8 files changed, 39 insertions, 47 deletions
diff --git a/wiretap/catapult_dct2000.c b/wiretap/catapult_dct2000.c index dfeca1de9b..7b02b0e341 100644 --- a/wiretap/catapult_dct2000.c +++ b/wiretap/catapult_dct2000.c @@ -22,7 +22,6 @@ #include <errno.h> #include <string.h> #include <stdlib.h> -#include <ctype.h> #include "wtap-int.h" #include "file_wrappers.h" @@ -871,7 +870,7 @@ parse_line(gchar *linebuff, gint line_length, *is_comment = TRUE; break; } - if (!isalnum((guchar)linebuff[n]) && (linebuff[n] != '_') && (linebuff[n] != '-')) { + if (!g_ascii_isalnum(linebuff[n]) && (linebuff[n] != '_') && (linebuff[n] != '-')) { return FALSE; } context_name[n] = linebuff[n]; @@ -899,7 +898,7 @@ parse_line(gchar *linebuff, gint line_length, (linebuff[n] != '/') && (port_digits <= MAX_PORT_DIGITS) && (n+1 < line_length); n++, port_digits++) { - if (!isdigit((guchar)linebuff[n])) { + if (!g_ascii_isdigit(linebuff[n])) { return FALSE; } port_number_string[port_digits] = linebuff[n]; @@ -928,7 +927,7 @@ parse_line(gchar *linebuff, gint line_length, (linebuff[n] != '/') && (protocol_chars < MAX_PROTOCOL_NAME) && (n < line_length); n++, protocol_chars++) { - if (!isalnum((guchar)linebuff[n]) && linebuff[n] != '_') { + if (!g_ascii_isalnum(linebuff[n]) && linebuff[n] != '_') { return FALSE; } protocol_name[protocol_chars] = linebuff[n]; @@ -949,10 +948,10 @@ parse_line(gchar *linebuff, gint line_length, /* Following the / is the variant number. No digits indicate 1 */ for (variant_digits = 0; - (isdigit((guchar)linebuff[n])) && (variant_digits <= MAX_VARIANT_DIGITS) && (n+1 < line_length); + (g_ascii_isdigit(linebuff[n])) && (variant_digits <= MAX_VARIANT_DIGITS) && (n+1 < line_length); n++, variant_digits++) { - if (!isdigit((guchar)linebuff[n])) { + if (!g_ascii_isdigit(linebuff[n])) { return FALSE; } variant_name[variant_digits] = linebuff[n]; @@ -983,11 +982,11 @@ parse_line(gchar *linebuff, gint line_length, n++; for (outhdr_chars = 0; - (isdigit((guchar)linebuff[n]) || linebuff[n] == ',') && + (g_ascii_isdigit(linebuff[n]) || linebuff[n] == ',') && (outhdr_chars <= MAX_OUTHDR_NAME) && (n+1 < line_length); n++, outhdr_chars++) { - if (!isdigit((guchar)linebuff[n]) && (linebuff[n] != ',')) { + if (!g_ascii_isdigit(linebuff[n]) && (linebuff[n] != ',')) { return FALSE; } outhdr_name[outhdr_chars] = linebuff[n]; @@ -1102,7 +1101,7 @@ parse_line(gchar *linebuff, gint line_length, aal_header_chars[header_chars_seen] = linebuff[n]; /* Next 6 characters after '9' are mapped to a->f */ - if (!isdigit((guchar)linebuff[n])) { + if (!g_ascii_isdigit(linebuff[n])) { aal_header_chars[header_chars_seen] = 'a' + (linebuff[n] - '9') -1; } } @@ -1118,7 +1117,7 @@ parse_line(gchar *linebuff, gint line_length, /* If there is a number, skip all info to next '/'. TODO: for IP encapsulation, should store PDCP ueid, drb in pseudo info and display dct2000 dissector... */ - if (isdigit((guchar)linebuff[n])) { + if (g_ascii_isdigit(linebuff[n])) { while ((n+1 < line_length) && linebuff[n] != '/') { n++; } @@ -1165,7 +1164,7 @@ parse_line(gchar *linebuff, gint line_length, return FALSE; } - for (; (n < line_length) && !isdigit((guchar)linebuff[n]); n++); + for (; (n < line_length) && !g_ascii_isdigit(linebuff[n]); n++); if (n >= line_length) { return FALSE; } @@ -1179,7 +1178,7 @@ parse_line(gchar *linebuff, gint line_length, (n < line_length); n++, seconds_chars++) { - if (!isdigit((guchar)linebuff[n])) { + if (!g_ascii_isdigit(linebuff[n])) { /* Found a non-digit before decimal point. Fail */ return FALSE; } @@ -1208,7 +1207,7 @@ parse_line(gchar *linebuff, gint line_length, (n < line_length); n++, subsecond_decimals_chars++) { - if (!isdigit((guchar)linebuff[n])) { + if (!g_ascii_isdigit(linebuff[n])) { return FALSE; } subsecond_decimals_buff[subsecond_decimals_chars] = linebuff[n]; @@ -1432,7 +1431,7 @@ set_aal_info(union wtap_pseudo_header *pseudo_header, /* cid is usually last byte. Unless last char is not hex digit, in which case cid is derived from last char in ascii */ - if (isalnum((guchar)aal_header_chars[11])) { + if (g_ascii_isalnum(aal_header_chars[11])) { pseudo_header->dct2000.inner_pseudo_header.atm.aal2_cid = hex_byte_from_chars(aal_header_chars+10); } diff --git a/wiretap/cosine.c b/wiretap/cosine.c index b7109ff7f9..4ce5437245 100644 --- a/wiretap/cosine.c +++ b/wiretap/cosine.c @@ -30,7 +30,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <ctype.h> /* @@ -182,7 +181,7 @@ static int parse_single_hex_dump_line(char* rec, guint8 *buf, static gboolean empty_line(const gchar *line) { while (*line) { - if (isspace((guchar)*line)) { + if (g_ascii_isspace(*line)) { line++; continue; } else { diff --git a/wiretap/daintree-sna.c b/wiretap/daintree-sna.c index eeddbc800f..555a054d0d 100644 --- a/wiretap/daintree-sna.c +++ b/wiretap/daintree-sna.c @@ -51,7 +51,6 @@ #include <stdlib.h> #include <errno.h> #include <string.h> -#include <ctype.h> #include "wtap.h" #include "wtap-int.h" @@ -237,28 +236,28 @@ daintree_sna_process_hex_data(struct wtap_pkthdr *phdr, Buffer *buf, /* convert hex string to guint8 */ while(*str) { /* most significant nibble */ - if (!isxdigit((guchar)*str)) { + if (!g_ascii_isxdigit(*str)) { *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup("daintree_sna: non-hex digit in hex data"); return FALSE; } - if(isdigit((guchar)*str)) { + if(g_ascii_isdigit(*str)) { *p = (*str - '0') << 4; } else { - *p = ((tolower(*str) - 'a') + 10) << 4; + *p = ((g_ascii_tolower(*str) - 'a') + 10) << 4; } str++; /* least significant nibble */ - if (!isxdigit((guchar)*str)) { + if (!g_ascii_isxdigit(*str)) { *err = WTAP_ERR_BAD_FILE; *err_info = g_strdup("daintree_sna: non-hex digit in hex data"); return FALSE; } - if(isdigit((guchar)*str)) { + if(g_ascii_isdigit(*str)) { *p += *str - '0'; } else { - *p += (tolower(*str) - 'a') + 10; + *p += (g_ascii_tolower(*str) - 'a') + 10; } str++; diff --git a/wiretap/dbs-etherwatch.c b/wiretap/dbs-etherwatch.c index 266ffa4cfc..f3029e2c10 100644 --- a/wiretap/dbs-etherwatch.c +++ b/wiretap/dbs-etherwatch.c @@ -27,7 +27,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <ctype.h> /* This module reads the text output of the 'DBS-ETHERTRACE' command in VMS * It was initially based on vms.c. @@ -324,7 +323,7 @@ parse_dbs_etherwatch_packet(struct wtap_pkthdr *phdr, FILE_T fh, Buffer* buf, * 'HEX' character */ p = line; - while(!isxdigit((guchar)*p)) { + while(!g_ascii_isxdigit(*p)) { p++; } if(parse_hex_dump(p, &pd[eth_hdr_len], HEX_HDR_SPR, @@ -549,8 +548,8 @@ parse_single_hex_dump_line(char* rec, guint8 *buf, int byte_offset) { /* Get the byte_offset directly from the record */ value = 0; for(i = 0; i < COUNT_SIZE; i++) { - if(!isspace((guchar)rec[pos])) { - if(isdigit((guchar)rec[pos])) { + if(!g_ascii_isspace(rec[pos])) { + if(g_ascii_isdigit(rec[pos])) { value *= 10; value += rec[pos] - '0'; } else { @@ -585,21 +584,21 @@ parse_hex_dump(char* dump, guint8 *buf, char seperator, char end) { count = 0; while(dump[pos] != end) { /* Check the hex value */ - if(!(isxdigit((guchar)dump[pos]) && - isxdigit((guchar)dump[pos + 1]))) { + if(!(g_ascii_isxdigit(dump[pos]) && + g_ascii_isxdigit(dump[pos + 1]))) { return 0; } /* Get the hex value value */ - if(isdigit((guchar)dump[pos])) { + if(g_ascii_isdigit(dump[pos])) { buf[count] = (dump[pos] - '0') << 4; } else { - buf[count] = (toupper(dump[pos]) - 'A' + 10) << 4; + buf[count] = (g_ascii_toupper(dump[pos]) - 'A' + 10) << 4; } pos++; - if(isdigit((guchar)dump[pos])) { + if(g_ascii_isdigit(dump[pos])) { buf[count] += dump[pos] - '0'; } else { - buf[count] += toupper(dump[pos]) - 'A' + 10; + buf[count] += g_ascii_toupper(dump[pos]) - 'A' + 10; } pos++; count++; diff --git a/wiretap/dct3trace.c b/wiretap/dct3trace.c index 873d96485b..6f35fb9416 100644 --- a/wiretap/dct3trace.c +++ b/wiretap/dct3trace.c @@ -33,7 +33,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <ctype.h> /* @@ -85,7 +84,7 @@ static gboolean dct3trace_seek_read(wtap *wth, gint64 seek_off, static int hc2b(unsigned char hex) { - hex = tolower(hex); + hex = g_ascii_tolower(hex); if ((hex >= '0') && (hex <= '9')) return hex - '0'; if ((hex >= 'a') && (hex <= 'f')) diff --git a/wiretap/iseries.c b/wiretap/iseries.c index e4d306eb93..a629eb8a4d 100644 --- a/wiretap/iseries.c +++ b/wiretap/iseries.c @@ -157,7 +157,6 @@ Number S/R Length Timer MAC Address MAC Address #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <ctype.h> #include <errno.h> #include <wsutil/str_util.h> @@ -504,7 +503,7 @@ append_hex_digits(char *ascii_buf, int ascii_offset, int max_offset, { goto done; } - if (!isxdigit(c) || islower(c)) + if (!g_ascii_isxdigit(c) || g_ascii_islower(c)) { /* * Not a hex digit, or a lower-case hex digit. @@ -714,7 +713,7 @@ iseries_parse_packet (wtap * wth, FILE_T fh, struct wtap_pkthdr *phdr, /* * Skip leading white space. */ - for (offset = 0; isspace((guchar)data[offset]); offset++) + for (offset = 0; g_ascii_isspace(data[offset]); offset++) ; /* diff --git a/wiretap/netscreen.c b/wiretap/netscreen.c index b34312fd84..cce6924463 100644 --- a/wiretap/netscreen.c +++ b/wiretap/netscreen.c @@ -31,7 +31,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <ctype.h> /* XXX TODO: * @@ -88,7 +87,7 @@ static gboolean info_line(const gchar *line) int i=NETSCREEN_SPACES_ON_INFO_LINE; while (i-- > 0) { - if (isspace((guchar)*line)) { + if (g_ascii_isspace(*line)) { line++; continue; } else { @@ -348,7 +347,7 @@ parse_netscreen_hex_dump(FILE_T fh, int pkt_len, const char *cap_int, * interfaces, there may be 14 extra spaces before * the hex data. */ - for (p = &line[0]; isspace((guchar)*p); p++) + for (p = &line[0]; g_ascii_isspace(*p); p++) ; /* packets are delimited with empty lines */ if (*p == '\0') { diff --git a/wiretap/vms.c b/wiretap/vms.c index 6a1c5fb6a2..f3d14a4c23 100644 --- a/wiretap/vms.c +++ b/wiretap/vms.c @@ -34,7 +34,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <ctype.h> /* This module reads the output of the various VMS TCPIP trace utilities * such as TCPIPTRACE, TCPTRACE and UCX$TRACE @@ -301,12 +300,12 @@ isdumpline( gchar *line ) { int i, j; - while (*line && !isalnum((guchar)*line)) + while (*line && !g_ascii_isalnum(*line)) line++; for (j=0; j<4; j++) { for (i=0; i<8; i++, line++) - if (! isxdigit((guchar)*line)) + if (! g_ascii_isxdigit(*line)) return FALSE; for (i=0; i<3; i++, line++) @@ -314,7 +313,7 @@ isdumpline( gchar *line ) return FALSE; } - return isspace((guchar)*line); + return g_ascii_isspace(*line); } /* Parses a packet record. */ @@ -380,7 +379,7 @@ parse_vms_packet(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, int *err, gch } if ( (! pkt_len) && (p = strstr(line, "Length"))) { p += sizeof("Length "); - while (*p && ! isdigit((guchar)*p)) + while (*p && ! g_ascii_isdigit(*p)) p++; if ( !*p ) { @@ -432,7 +431,7 @@ parse_vms_packet(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, int *err, gch } line[VMS_LINE_LENGTH] = '\0'; } - while (line[offset] && !isxdigit((guchar)line[offset])) + while (line[offset] && !g_ascii_isxdigit(line[offset])) offset++; } if (!parse_single_hex_dump_line(line, pd, i, |