[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [PATCH] Accept %z in printf formats



Before, we only supported %Z (upper-case). It seems that the lower-case
version is standard, and this matches the behaviour of Xen's vsprintf.c.

Signed-off-by: Thomas Leonard <talex5@xxxxxxxxx>
---
 lib/printf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/printf.c b/lib/printf.c
index 3d02e95..40f92fc 100644
--- a/lib/printf.c
+++ b/lib/printf.c
@@ -346,12 +346,14 @@ int vsnprintf(char *buf, size_t size, const char *fmt, 
va_list args)
 
         /* get the conversion qualifier */
         qualifier = -1;
-        if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='Z') {
+        if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='Z' || *fmt == 
'z') {
             qualifier = *fmt;
             ++fmt;
             if (qualifier == 'l' && *fmt == 'l') {
                 qualifier = 'L';
                 ++fmt;
+            } else if (qualifier == 'z') {
+                qualifier = 'Z';
             }
         }
         if (*fmt == 'q') {
-- 
2.4.2


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.