mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
fwd-port win32 isprint fix
svn:r3410
This commit is contained in:
parent
1dc4d9a0ce
commit
fbb7f869c5
@ -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);
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user