summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-01-22 00:42:58 +0000
committerNick Mathewson <nickm@torproject.org>2005-01-22 00:42:58 +0000
commitfbb7f869c5cff8c771c73ab90f52d7017051693f (patch)
treed52ef39b92553dba9393f9da51f75f13f6316fcc
parent1dc4d9a0ceb5aacb7f44416950a7b794380b1a3a (diff)
downloadtor-fbb7f869c5cff8c771c73ab90f52d7017051693f.tar.gz
tor-fbb7f869c5cff8c771c73ab90f52d7017051693f.zip
fwd-port win32 isprint fix
svn:r3410
-rw-r--r--src/common/compat.h1
-rw-r--r--src/or/directory.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/common/compat.h b/src/common/compat.h
index 186416d882..e10a6b620d 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -85,6 +85,7 @@ int tor_vsnprintf(char *str, size_t size, const char *format, va_list args);
#define TOR_ISSPACE(c) isspace((int)(unsigned char)(c))
#define TOR_ISXDIGIT(c) isxdigit((int)(unsigned char)(c))
#define TOR_ISDIGIT(c) isdigit((int)(unsigned char)(c))
+#define TOR_ISPRINT(c) isprint((int)(unsigned char)(c))
#define _SHORT_FILE_ (_tor_fix_source_file(__FILE__))
const char *_tor_fix_source_file(const char *fname);
diff --git a/src/or/directory.c b/src/or/directory.c
index 6fabc52450..446c9eda73 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -566,7 +566,7 @@ body_is_plausible(const char *body, size_t len, int purpose)
!strcmpstart(body,"running-routers"))
return 1;
for (i=0;i<32;++i) {
- if (!isprint(body[i]) && !isspace(body[i]))
+ if (!TOR_ISPRINT(body[i]) && !TOR_ISSPACE(body[i]))
return 0;
}
return 1;