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

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



Thomas Leonard, le Wed 01 Jul 2015 10:24:50 +0100, a écrit :
> 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 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
> 

-- 
Samuel
Anyone who thinks UNIX is intuitive should be forced to write 5000 lines of 
code using nothing but vi or emacs. AAAAACK!
(Discussion in comp.os.linux.misc on the intuitiveness of commands, especially
Emacs.)

_______________________________________________
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®.