浏览代码

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

Nick Mathewson 8 年之前
父节点
当前提交
44cbd00dfa
共有 1 个文件被更改,包括 2 次插入0 次删除
  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;