Browse Source

Belt *or* suspenders will be sufficient when casting things to unsigned char.

svn:r3122
Nick Mathewson 21 years ago
parent
commit
fd4c624677
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/common/crypto.c

+ 2 - 3
src/common/crypto.c

@@ -974,12 +974,11 @@ int
 crypto_pk_check_fingerprint_syntax(const char *s)
 crypto_pk_check_fingerprint_syntax(const char *s)
 {
 {
   int i;
   int i;
-  const unsigned char *cp = s;
   for (i = 0; i < FINGERPRINT_LEN; ++i) {
   for (i = 0; i < FINGERPRINT_LEN; ++i) {
     if ((i%5) == 4) {
     if ((i%5) == 4) {
-      if (!TOR_ISSPACE(cp[i])) return 0;
+      if (!TOR_ISSPACE(s[i])) return 0;
     } else {
     } else {
-      if (!TOR_ISXDIGIT(cp[i])) return 0;
+      if (!TOR_ISXDIGIT(s[i])) return 0;
     }
     }
   }
   }
   if (s[FINGERPRINT_LEN]) return 0;
   if (s[FINGERPRINT_LEN]) return 0;