]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make our replacement INT32_MAX always signed
authorNick Mathewson <nickm@torproject.org>
Wed, 12 Jan 2011 19:29:38 +0000 (14:29 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 12 Jan 2011 19:29:38 +0000 (14:29 -0500)
The C standard says that INT32_MAX is supposed to be a signed
integer.  On platforms that have it, we get the correct
platform-defined value.  Our own replacement, however, was
unsigned.  That's going to cause a bug somewhere eventually.

src/common/torint.h

index 4970dcd674b5ebdccce27260fa9f7df4e8fd0484..2a9fba6fcf7846de1949102a15195c83b48019aa 100644 (file)
@@ -115,7 +115,7 @@ typedef unsigned int uint32_t;
 #define UINT32_MAX 0xffffffffu
 #endif
 #ifndef INT32_MAX
-#define INT32_MAX 0x7fffffffu
+#define INT32_MAX 0x7fffffff
 #endif
 #endif