From 1533faf160b1456dd03865f117773abb823adc7a Mon Sep 17 00:00:00 2001 From: guanglei Date: Tue, 9 May 2006 06:19:29 +0000 Subject: %0s support to print null-terminated string --- runtime/vsprintf.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/vsprintf.c') diff --git a/runtime/vsprintf.c b/runtime/vsprintf.c index 44e431fb..ba0bc85a 100644 --- a/runtime/vsprintf.c +++ b/runtime/vsprintf.c @@ -275,6 +275,11 @@ int _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args) *str = ' '; ++str; } + if(flags & STP_ZEROPAD) { + if (str <= end) + *str = '\0'; + ++str; + } continue; case 'X': -- cgit