From d2ed254fb8d27f9dcefb505b0c2a6808e1f4630b Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 26 Apr 2000 21:15:14 +0000 Subject: [PATCH] (..., "%03u", 2) was not zero filling --- lib/isc/print.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/isc/print.c b/lib/isc/print.c index 75af14eff9..51b0c9b4fd 100644 --- a/lib/isc/print.c +++ b/lib/isc/print.c @@ -297,7 +297,9 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) { length = strlen(buf); if (length < precision) zeropad = precision - length; - if (width) { + else if (length < width && zero) + zeropad = width - length; + if (width != 0) { pad = width - length - zeropad - strlen(head); if (pad < 0)