[tor-commits] [tor/master] Fix a compiler warning on windows when sizeof(long)==sizeof(int)

nickm at torproject.org nickm at torproject.org
Thu May 12 18:51:42 UTC 2016


commit 44cbd00dfaba8314dea274d5c4535adc3c202220
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu May 12 14:51:38 2016 -0400

    Fix a compiler warning on windows when sizeof(long)==sizeof(int)
---
 src/common/util.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/common/util.c b/src/common/util.c
index d290f54..d1c8b2e 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;



More information about the tor-commits mailing list