aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-02-11 09:19:54 +0000
committerGuy Harris <guy@alum.mit.edu>2004-02-11 09:19:54 +0000
commitf99bb93e552820fe4d0ab67f01361c76712c19e7 (patch)
treef5dc44d122e67563e38b5a49fd432f33eaf63b69
parent8177fbd5503cf1698a469e763766f81fa75e8bf7 (diff)
Cast "char" values to "guchar" before passing them to <ctype.h> macros,
so that characters with the 8th bit set don't get sign-extended and cause the macros not to return the right answer. svn path=/trunk/; revision=10036
-rw-r--r--gtk/main.c4
-rwxr-xr-xpacket-multipart.c6
-rw-r--r--packet-sip.c4
-rw-r--r--range.c6
4 files changed, 10 insertions, 10 deletions
diff --git a/gtk/main.c b/gtk/main.c
index e6065c0b7d..cecc6dcbb0 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -1,6 +1,6 @@
/* main.c
*
- * $Id: main.c,v 1.393 2004/02/11 03:55:48 guy Exp $
+ * $Id: main.c,v 1.394 2004/02/11 09:19:54 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1461,7 +1461,7 @@ set_autostop_criterion(const char *autostoparg)
* as we allow it in the preferences file, we might as well
* allow it here).
*/
- while (isspace(*p))
+ while (isspace((guchar)*p))
p++;
if (*p == '\0') {
/*
diff --git a/packet-multipart.c b/packet-multipart.c
index 75de2696ba..f303354dce 100755
--- a/packet-multipart.c
+++ b/packet-multipart.c
@@ -3,7 +3,7 @@
* Copyright 2004, Anders Broman <anders.broman[at]ericsson.com>
* Copyright 2004, Olivier Biot <olivier.biot[at]siemens.com>
*
- * $Id: packet-multipart.c,v 1.6 2004/02/06 01:07:51 obiot Exp $
+ * $Id: packet-multipart.c,v 1.7 2004/02/11 09:19:02 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -318,7 +318,7 @@ get_multipart_info(packet_info *pinfo)
if (p == NULL)
return NULL;
p++; /* Skip semicolon */
- while ((*p) && isspace(*p))
+ while ((*p) && isspace((guchar)*p))
p++; /* Skip white space */
}
start = p + 9;
@@ -347,7 +347,7 @@ get_multipart_info(packet_info *pinfo)
*/
p = start;
while (*p) {
- if (*p == ';' || isspace(*p))
+ if (*p == ';' || isspace((guchar)*p))
break;
p++;
len++;
diff --git a/packet-sip.c b/packet-sip.c
index 4940af4af8..1bb555ecca 100644
--- a/packet-sip.c
+++ b/packet-sip.c
@@ -18,7 +18,7 @@
* Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi>
* Copyright 2001, Jean-Francois Mule <jfm@cablelabs.com>
*
- * $Id: packet-sip.c,v 1.58 2004/02/03 20:39:58 guy Exp $
+ * $Id: packet-sip.c,v 1.59 2004/02/11 09:19:02 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -654,7 +654,7 @@ dissect_sip_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Extract method name from value */
for (value_offset = 0; value_offset < (gint)strlen(value); value_offset++)
{
- if (isalpha(value[value_offset]))
+ if (isalpha((guchar)value[value_offset]))
{
strcpy(csec_method,value+value_offset);
break;
diff --git a/range.c b/range.c
index cea55eb419..0ff0dcacf5 100644
--- a/range.c
+++ b/range.c
@@ -1,7 +1,7 @@
/* range.c
* Packet range routines (save, print, ...)
*
- * $Id: range.c,v 1.8 2004/01/09 18:10:40 ulfl Exp $
+ * $Id: range.c,v 1.9 2004/02/11 09:19:54 guy Exp $
*
* Dick Gooris <gooris@lucent.com>
* Ulf Lamping <ulf.lamping@web.de>
@@ -288,7 +288,7 @@ void packet_range_convert_str(packet_range_t *range, const gchar *es)
/* Only keep digits, commas, and hyphens. */
for (i=0; i<=strlen(OrgStr); i++) {
- if ( isdigit(OrgStr[i]) || OrgStr[i] == '-' || OrgStr[i] == ',' ) {
+ if ( isdigit((guchar)OrgStr[i]) || OrgStr[i] == '-' || OrgStr[i] == ',' ) {
EntryStr[j++] = OrgStr[i];
}
}
@@ -349,7 +349,7 @@ void packet_range_convert_str(packet_range_t *range, const gchar *es)
for (i=0; i<=strlen(EntryStr);i++) {
/* Copy the digit string until a no-digit character is seen */
- if (isdigit(EntryStr[i])) {
+ if (isdigit((guchar)EntryStr[i])) {
value[j++] = EntryStr[i];
continue;
}