<smhuang [AT] pcs.csie.nctu.edu.tw>
Michael Kopp <michael.kopp [AT] isarnet.de>
Bernd Leibing <bernd.leibing [AT] kiz.uni-ulm.de>
+ Chris Heath <chris [AT] heathens.co.nz>
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to
give his permission to use his version of snprintf.c.
<smhuang [AT] pcs.csie.nctu.edu.tw>
Michael Kopp <michael.kopp [AT] isarnet.de>
Bernd Leibing <bernd.leibing [AT] kiz.uni-ulm.de>
+ Chris Heath <chris [AT] heathens.co.nz>
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to give his
permission to use his version of snprintf.c.
/* strutil.c
* String utility routines
*
- * $Id: strutil.c,v 1.10 2002/12/31 21:51:10 guy Exp $
+ * $Id: strutil.c,v 1.11 2003/08/01 01:39:00 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#define INITIAL_FMTBUF_SIZE 128
+#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.
+ */
+#undef isprint
+#define isprint(c) (c >= 0x20 && c < 0x7f)
+#endif
+
/*
* Given a string, generate a string from it that shows non-printable
* characters as C-style escapes, and return a pointer to it.
}
c = *string++;
-#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
fmtbuf[column] = c;
column++;
} else {
/* gtkglobals.h
* GTK-related Global defines, etc.
*
- * $Id: gtkglobals.h,v 1.21 2002/12/31 21:49:00 guy Exp $
+ * $Id: gtkglobals.h,v 1.22 2003/08/01 01:39:01 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
* the problem by escaping all characters that aren't printable ASCII.
*/
#undef isprint
-#define isprint(c) (c >= 0x20 && c <= 0x7f)
+#define isprint(c) (c >= 0x20 && c < 0x7f)
#endif
#endif