]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fixup snprintf warning for 32bit systems.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 27 Oct 2015 14:51:57 +0000 (14:51 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 27 Oct 2015 14:51:57 +0000 (14:51 +0000)
git-svn-id: file:///svn/unbound/trunk@3520 be551aaa-1e26-0410-a405-d3ace91eadb9

compat/snprintf.c

index 0663557037f8d99c857c27717b48e454c69111a3..97cd7061f5c9feb2a2e5b6e7be2f73e2e9647cc6 100644 (file)
@@ -42,6 +42,7 @@
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif
+#include <limits.h>
 
 /* for test */
 /* #define SNPRINTF_TEST 1 */
@@ -428,7 +429,7 @@ print_num_llp(char** at, size_t* left, int* ret, void* value,
        char buf[PRINT_DEC_BUFSZ];
        int negative = 0;
        int zero = (value == 0);
-#if defined(UINTPTR_MAX) && defined(UINT32_MAX) && (UINTPTR_MAX == UINT32_MAX)
+#if defined(SIZE_MAX) && defined(UINT32_MAX) && (UINT32_MAX == SIZE_MAX || INT32_MAX == SIZE_MAX)
        /* avoid warning about upcast on 32bit systems */
        unsigned long long llvalue = (unsigned long)value;
 #else