mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-03 16:15:27 +00:00
Only use %ll? when long long int != long int.
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <isc/assertions.h>
|
#include <isc/assertions.h>
|
||||||
#include <isc/print.h>
|
#include <isc/print.h>
|
||||||
|
#include <isc/platform.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return length of string that would have been written if not truncated.
|
* Return length of string that would have been written if not truncated.
|
||||||
@@ -215,7 +216,11 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
|
|||||||
head = "";
|
head = "";
|
||||||
tmpui = tmpi;
|
tmpui = tmpi;
|
||||||
}
|
}
|
||||||
|
#ifdef ISC_PLATFORM_LONGLONGEQUALLONG
|
||||||
|
sprintf(buf, "%lu", tmpui);
|
||||||
|
#else
|
||||||
sprintf(buf, "%llu", tmpui);
|
sprintf(buf, "%llu", tmpui);
|
||||||
|
#endif
|
||||||
goto printint;
|
goto printint;
|
||||||
case 'o':
|
case 'o':
|
||||||
if (q)
|
if (q)
|
||||||
@@ -224,7 +229,11 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
|
|||||||
tmpi = va_arg(ap, long int);
|
tmpi = va_arg(ap, long int);
|
||||||
else
|
else
|
||||||
tmpi = va_arg(ap, int);
|
tmpi = va_arg(ap, int);
|
||||||
|
#ifdef ISC_PLATFORM_LONGLONGEQUALLONG
|
||||||
|
sprintf(buf, alt ? "%#lo" : "%lo", tmpui);
|
||||||
|
#else
|
||||||
sprintf(buf, alt ? "%#llo" : "%llo", tmpui);
|
sprintf(buf, alt ? "%#llo" : "%llo", tmpui);
|
||||||
|
#endif
|
||||||
goto printint;
|
goto printint;
|
||||||
case 'u':
|
case 'u':
|
||||||
if (q)
|
if (q)
|
||||||
@@ -233,7 +242,11 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
|
|||||||
tmpui = va_arg(ap, unsigned long int);
|
tmpui = va_arg(ap, unsigned long int);
|
||||||
else
|
else
|
||||||
tmpui = va_arg(ap, unsigned int);
|
tmpui = va_arg(ap, unsigned int);
|
||||||
|
#ifdef ISC_PLATFORM_LONGLONGEQUALLONG
|
||||||
|
sprintf(buf, "%lu", tmpui);
|
||||||
|
#else
|
||||||
sprintf(buf, "%llu", tmpui);
|
sprintf(buf, "%llu", tmpui);
|
||||||
|
#endif
|
||||||
goto printint;
|
goto printint;
|
||||||
case 'x':
|
case 'x':
|
||||||
if (q)
|
if (q)
|
||||||
@@ -247,7 +260,11 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
|
|||||||
if (precision > 2)
|
if (precision > 2)
|
||||||
precision -= 2;
|
precision -= 2;
|
||||||
}
|
}
|
||||||
|
#ifdef ISC_PLATFORM_LONGLONGEQUALLONG
|
||||||
|
sprintf(buf, "%lx", tmpui);
|
||||||
|
#else
|
||||||
sprintf(buf, "%llx", tmpui);
|
sprintf(buf, "%llx", tmpui);
|
||||||
|
#endif
|
||||||
goto printint;
|
goto printint;
|
||||||
case 'X':
|
case 'X':
|
||||||
if (q)
|
if (q)
|
||||||
@@ -261,7 +278,11 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
|
|||||||
if (precision > 2)
|
if (precision > 2)
|
||||||
precision -= 2;
|
precision -= 2;
|
||||||
}
|
}
|
||||||
|
#ifdef ISC_PLATFORM_LONGLONGEQUALLONG
|
||||||
|
sprintf(buf, "%lX", tmpui);
|
||||||
|
#else
|
||||||
sprintf(buf, "%llX", tmpui);
|
sprintf(buf, "%llX", tmpui);
|
||||||
|
#endif
|
||||||
goto printint;
|
goto printint;
|
||||||
printint:
|
printint:
|
||||||
if (precision != 0 || width != 0) {
|
if (precision != 0 || width != 0) {
|
||||||
|
Reference in New Issue
Block a user