Przeglądaj źródła

Fix a compiler warning on windows when sizeof(long)==sizeof(int)

Nick Mathewson 8 lat temu
rodzic
commit
44cbd00dfa
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      src/common/util.c

+ 2 - 0
src/common/util.c

@@ -3273,8 +3273,10 @@ tor_vsscanf(const char *buf, const char *pattern, va_list ap)
           *out = lng;
         } else {
           int *out = va_arg(ap, int *);
+#if LONG_MAX > INT_MAX
           if (lng < INT_MIN || lng > INT_MAX)
             return n_matched;
+#endif
           *out = (int)lng;
         }
         ++pattern;