summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-05-12 14:51:38 -0400
committerNick Mathewson <nickm@torproject.org>2016-05-12 14:51:38 -0400
commit44cbd00dfaba8314dea274d5c4535adc3c202220 (patch)
treee81978bebb3decda54106deb723cda96bee2ab08 /src/common
parent6bc052365a8dbfc9ed7c43e69761099ba973af74 (diff)
downloadtor-44cbd00dfaba8314dea274d5c4535adc3c202220.tar.gz
tor-44cbd00dfaba8314dea274d5c4535adc3c202220.zip
Fix a compiler warning on windows when sizeof(long)==sizeof(int)
Diffstat (limited to 'src/common')
-rw-r--r--src/common/util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c
index d290f545a0..d1c8b2ee4c 100644
--- a/src/common/util.c
+++ b/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;