Przeglądaj źródła

fix a signed/unsigned comparison

svn:r2446
Roger Dingledine 21 lat temu
rodzic
commit
578a3e25e5
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/or/routerparse.c

+ 1 - 1
src/or/routerparse.c

@@ -1445,7 +1445,7 @@ int tor_version_as_new_as(const char *platform, const char *cutoff) {
   start = (char *)eat_whitespace(platform+3);
   start = (char *)eat_whitespace(platform+3);
   if (!*start) return 0;
   if (!*start) return 0;
   s = (char *)find_whitespace(start); /* also finds '\0', which is fine */
   s = (char *)find_whitespace(start); /* also finds '\0', which is fine */
-  if(s-start+1 >= sizeof(tmp)) /* too big, no */
+  if((size_t)(s-start+1) >= sizeof(tmp)) /* too big, no */
     return 0;
     return 0;
   strlcpy(tmp, start, s-start+1);
   strlcpy(tmp, start, s-start+1);