aboutsummaryrefslogtreecommitdiffstats
path: root/packet-radius.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-01-28 16:31:03 +0000
committerGuy Harris <guy@alum.mit.edu>2003-01-28 16:31:03 +0000
commit7d460217208988f6f7f3b18f4e665bd24c3aea2c (patch)
treeb71b1b75c7f7ff00d900f9066a1bbac7830b0fb4 /packet-radius.c
parent77b96651e2767a0bb037f6d327279c3f4db07bce (diff)
Do the usual "isprint()" workaround for versions of GTK+ that assume
UTF-8 strings. svn path=/trunk/; revision=7020
Diffstat (limited to 'packet-radius.c')
-rw-r--r--packet-radius.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/packet-radius.c b/packet-radius.c
index 38d28bd9aa..339fa3ccba 100644
--- a/packet-radius.c
+++ b/packet-radius.c
@@ -5,7 +5,7 @@
*
* RFC 2865, RFC 2866, RFC 2867, RFC 2868, RFC 2869
*
- * $Id: packet-radius.c,v 1.72 2002/12/17 22:49:33 guy Exp $
+ * $Id: packet-radius.c,v 1.73 2003/01/28 16:31:03 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -2391,7 +2391,19 @@ rddecryptpass(gchar *dest,tvbuff_t *tvb,int offset,int length)
pd = tvb_get_ptr(tvb,offset,length);
for( i = 0 ; i < 16 && i < (guint32)length ; i++ ) {
c = pd[i] ^ digest[i];
+#ifdef _WIN32
+ /*
+ * XXX - "isprint()" can return "true" for non-ASCII characters, but
+ * those don't work with GTK+ on Windows, as GTK+ on Windows assumes
+ * UTF-8 strings. Until we fix up Ethereal to properly handle
+ * non-ASCII characters in all output (both GUI displays and text
+ * printouts) on all platforms including Windows, we work around
+ * the problem by escaping all characters that aren't printable ASCII.
+ */
+ if ( c >= 0x20 && c <= 0x7f) {
+#else
if ( isprint(c)) {
+#endif
dest[totlen] = c;
totlen++;
} else {
@@ -2400,7 +2412,19 @@ rddecryptpass(gchar *dest,tvbuff_t *tvb,int offset,int length)
}
}
while(i<(guint32)length) {
+#ifdef _WIN32
+ /*
+ * XXX - "isprint()" can return "true" for non-ASCII characters, but
+ * those don't work with GTK+ on Windows, as GTK+ on Windows assumes
+ * UTF-8 strings. Until we fix up Ethereal to properly handle
+ * non-ASCII characters in all output (both GUI displays and text
+ * printouts) on all platforms including Windows, we work around
+ * the problem by escaping all characters that aren't printable ASCII.
+ */
+ if ( pd[i] >= 0x20 && pd[i] <= 0x7f) {
+#else
if ( isprint(pd[i]) ) {
+#endif
dest[totlen] = (gchar)pd[i];
totlen++;
} else {