On Mon, Feb 14, 2022 at 08:04:35PM +0800, Du Huanpeng wrote:

> the %zx format are used in spl from files below:
>   lib/lzma/LzmaTools.c
>   common/malloc_simple.c
> 
> it results output like "... 0xx", "size=x" output,
> treat '%z' as '%l' to support `ssize_t' type.
> 
> Signed-off-by: Du Huanpeng <d...@hodcarrier.org>
> ---
>  lib/tiny-printf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c
> index 8fc7e48..4b65f72 100644
> --- a/lib/tiny-printf.c
> +++ b/lib/tiny-printf.c
> @@ -228,7 +228,7 @@ static int _vprintf(struct printf_info *info, const char 
> *fmt, va_list va)
>                                       ch = *fmt++;
>                               }
>                       }
> -                     if (ch == 'l') {
> +                     if (ch == 'l' || ch == 'z') {
>                               ch = *(fmt++);
>                               islong = true;
>                       }

Generally, we try and change code rather than add more support to
tiny-printf as it's supposed to stay as tiny as possible.  See 
eebcdb34d061 ("malloc_simple: Remove usage of unsupported %zx format
string") for a recent example.

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to