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

[Xen-changelog] [mini-os master] Accept %z in printf formats



commit e6e91f5c2fac25d5f497efa70e7ffb7bdf4987b0
Author:     Thomas Leonard <talex5@xxxxxxxxx>
AuthorDate: Wed Jul 1 10:24:50 2015 +0100
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Fri Jul 3 10:14:55 2015 +0100

    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>
    Acked-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
---
 lib/printf.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

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') {
--
generated by git-patchbot for /home/xen/git/mini-os.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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