Browse Source

consdiff: Fix 32-bit compilation.

Thanks, jenkins!
Nick Mathewson 7 years ago
parent
commit
eca9b3424d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/or/consdiff.c

+ 2 - 1
src/or/consdiff.c

@@ -391,7 +391,8 @@ get_id_hash(const cdline_t *line, cdline_t *hash_out)
 
   hash_out->s = hash;
   /* Always true because lines are limited to this length */
-  tor_assert(hash_end - hash <= UINT32_MAX);
+  tor_assert(hash_end >= hash);
+  tor_assert((size_t)(hash_end - hash) <= UINT32_MAX);
   hash_out->len = (uint32_t)(hash_end - hash);
 
   return 0;