fwd-port win32 isprint fix

svn:r3410
This commit is contained in:
Nick Mathewson 2005-01-22 00:42:58 +00:00
parent 1dc4d9a0ce
commit fbb7f869c5
2 changed files with 2 additions and 1 deletions

View File

@ -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_ISSPACE(c) isspace((int)(unsigned char)(c))
#define TOR_ISXDIGIT(c) isxdigit((int)(unsigned char)(c)) #define TOR_ISXDIGIT(c) isxdigit((int)(unsigned char)(c))
#define TOR_ISDIGIT(c) isdigit((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__)) #define _SHORT_FILE_ (_tor_fix_source_file(__FILE__))
const char *_tor_fix_source_file(const char *fname); const char *_tor_fix_source_file(const char *fname);

View File

@ -566,7 +566,7 @@ body_is_plausible(const char *body, size_t len, int purpose)
!strcmpstart(body,"running-routers")) !strcmpstart(body,"running-routers"))
return 1; return 1;
for (i=0;i<32;++i) { 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 0;
} }
return 1; return 1;