summaryrefslogtreecommitdiff
path: root/smbutil.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-02-02 15:17:06 -0800
committerGuy Harris <guy@alum.mit.edu>2014-02-02 15:17:06 -0800
commit3454732513abdbd1490c6107a94c6474f71a74d2 (patch)
treebf0126f8412e8bb2144268691c4c6adc2342559f /smbutil.c
parent89e2444c8b41776ad96c7a4c90a7bc030165c259 (diff)
downloadtcpdump-3454732513abdbd1490c6107a94c6474f71a74d2.tar.gz
Do our own isascii(), isprint(), isgraph(), and toascii().
We do *not* want the behavior of isprint() and isgraph() to be locale-dependent - we want both of them to return "true" only for ASCII characters. We have to do our own isascii() and toascii() on non-UN*X systems anyway, so let's just do all of them ourselves.
Diffstat (limited to 'smbutil.c')
-rw-r--r--smbutil.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/smbutil.c b/smbutil.c
index 13333d00..43783aa4 100644
--- a/smbutil.c
+++ b/smbutil.c
@@ -329,7 +329,7 @@ write_bits(unsigned int val, const char *fmt)
}
}
-/* convert a UCS2 string into iso-8859-1 string */
+/* convert a UCS-2 string into an ASCII string */
#define MAX_UNISTR_SIZE 1000
static const char *
unistr(const u_char *s, u_int32_t *len, int use_unicode)
@@ -384,7 +384,7 @@ unistr(const u_char *s, u_int32_t *len, int use_unicode)
TCHECK(s[0]);
if (l >= MAX_UNISTR_SIZE)
break;
- if (isprint(s[0]))
+ if (ND_ISPRINT(s[0]))
buf[l] = s[0];
else {
if (s[0] == 0)
@@ -400,7 +400,7 @@ unistr(const u_char *s, u_int32_t *len, int use_unicode)
TCHECK2(s[0], 2);
if (l >= MAX_UNISTR_SIZE)
break;
- if (s[1] == 0 && isprint(s[0])) {
+ if (s[1] == 0 && ND_ISPRINT(s[0])) {
/* It's a printable ASCII character */
buf[l] = s[0];
} else {