summaryrefslogtreecommitdiff
path: root/src/common/crypto.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-12-08 00:42:50 +0000
committerNick Mathewson <nickm@torproject.org>2004-12-08 00:42:50 +0000
commitfe6eb34a10ccfc2ececbcc7459d0a1fb23b9b021 (patch)
tree806b089836d892e3024af375d8c0e95a9ef8fe00 /src/common/crypto.c
parentd7dbfd3644dac410cb4ee558f31b514ca3689afc (diff)
downloadtor-fe6eb34a10ccfc2ececbcc7459d0a1fb23b9b021.tar.gz
tor-fe6eb34a10ccfc2ececbcc7459d0a1fb23b9b021.zip
Solaris CC freaks out if isspace and friends get anything other than an int. We learned that, so we casted. But it is also a bad idea to cast a signed char to an int and expect things to work on win32. Now we cast to unsigned char, then to int, then pass to isspace. Ug
svn:r3120
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r--src/common/crypto.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 6d4533b5da..eaf438e835 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -974,11 +974,12 @@ int
crypto_pk_check_fingerprint_syntax(const char *s)
{
int i;
+ const unsigned char *cp = s;
for (i = 0; i < FINGERPRINT_LEN; ++i) {
if ((i%5) == 4) {
- if (!isspace((int)s[i])) return 0;
+ if (!TOR_ISSPACE(cp[i])) return 0;
} else {
- if (!isxdigit((int)s[i])) return 0;
+ if (!TOR_ISXDIGIT(cp[i])) return 0;
}
}
if (s[FINGERPRINT_LEN]) return 0;