From: Kern Sibbald Date: Sat, 29 May 2010 18:39:20 +0000 (+0200) Subject: Add z (size_t) prefix to bsnprintf X-Git-Tag: Release-7.0.0~1793 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=71c88b666cc071daa19fb863e117e04e5c3ec632;p=bacula%2Fbacula Add z (size_t) prefix to bsnprintf --- diff --git a/bacula/src/lib/bsnprintf.c b/bacula/src/lib/bsnprintf.c index 5fa592610b..dcd9923251 100644 --- a/bacula/src/lib/bsnprintf.c +++ b/bacula/src/lib/bsnprintf.c @@ -115,6 +115,7 @@ static int32_t fmtfp(char *buffer, int32_t currlen, int32_t maxlen, #define DP_C_LDOUBLE 3 #define DP_C_INT64 4 #define DP_C_WCHAR 5 /* wide characters */ +#define DP_C_SIZE_T 6 #define char_to_int(p) ((p)- '0') #undef MAX @@ -250,6 +251,10 @@ int bvsnprintf(char *buffer, int32_t maxlen, const char *format, va_list args) ch = *format++; } break; + case 'z': + cflags = DP_C_SIZE_T; + ch = *format++; + break; case 'L': cflags = DP_C_LDOUBLE; ch = *format++; @@ -273,6 +278,8 @@ int bvsnprintf(char *buffer, int32_t maxlen, const char *format, va_list args) value = va_arg(args, int32_t); } else if (cflags == DP_C_INT64) { value = va_arg(args, int64_t); + } else if (cflags == DP_C_SIZE_T) { + value = va_arg(args, ssize_t); } else { value = va_arg(args, int); } @@ -299,6 +306,8 @@ int bvsnprintf(char *buffer, int32_t maxlen, const char *format, va_list args) value = va_arg(args, uint32_t); } else if (cflags == DP_C_INT64) { value = va_arg(args, uint64_t); + } else if (cflags == DP_C_SIZE_T) { + value = va_arg(args, size_t); } else { value = va_arg(args, unsigned int); }