From: Todd C. Miller Date: Wed, 2 Apr 2008 19:28:27 +0000 (+0000) Subject: Use LLONG_MAX, not the old QUAD_MAX X-Git-Tag: SUDO_1_7_0~132 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66d388c3d4c646c18a88d8b2b3d166ef3d1a8369;p=sudo Use LLONG_MAX, not the old QUAD_MAX --- diff --git a/snprintf.c b/snprintf.c index a96e7e321..ecbf64f38 100644 --- a/snprintf.c +++ b/snprintf.c @@ -91,18 +91,18 @@ static int xxxprintf __P((char **, size_t, int, const char *, va_list)); # define LONG_MAX (ULONG_MAX / 2) #endif #ifdef HAVE_LONG_LONG -# ifndef UQUAD_MAX -# ifdef ULONG_LONG_MAX -# define UQUAD_MAX ULONG_LONG_MAX +# ifndef ULLONG_MAX +# ifdef UQUAD_MAX +# define ULLONG_MAX UQUAD_MAX # else -# define UQUAD_MAX ((unsigned long long)-1) +# define ULLONG_MAX ((unsigned long long)-1) # endif # endif -# ifndef QUAD_MAX -# ifdef LONG_LONG_MAX -# define QUAD_MAX LONG_LONG_MAX +# ifndef LLONG_MAX +# ifdef QUAD_MAX +# define LLONG_MAX QUAD_MAX # else -# define QUAD_MAX (UQUAD_MAX / 2) +# define LLONG_MAX (ULLONG_MAX / 2) # endif # endif #endif /* HAVE_LONG_LONG */ @@ -237,7 +237,7 @@ __uqtoa(val, endp, base, octzero, xdigs) *--cp = to_char(val % 10); return (cp); } - if (val > QUAD_MAX) { + if (val > LLONG_MAX) { *--cp = to_char(val % 10); sval = val / 10; } else