public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Andreas Schwab via Libc-alpha <libc-alpha@sourceware.org>
Cc: Andreas Schwab <schwab@suse.de>
Subject: Re: [PATCH] Don't use unsupported format string in ld.so (bug 29427)
Date: Mon, 01 Aug 2022 17:49:33 +0200	[thread overview]
Message-ID: <87a68om0aa.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <mvm35eghvii.fsf@suse.de> (Andreas Schwab via Libc-alpha's message of "Mon, 01 Aug 2022 16:46:13 +0200")

* Andreas Schwab via Libc-alpha:

> There is no support for printf format strings that contain a literal field
> width or precision in the dynamic loader, they have to be specified
> indirectly.
> ---
>  elf/dl-diagnostics.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/elf/dl-diagnostics.c b/elf/dl-diagnostics.c
> index dd3871b1e0..269c428c93 100644
> --- a/elf/dl-diagnostics.c
> +++ b/elf/dl-diagnostics.c
> @@ -108,7 +108,7 @@ _dl_diagnostics_print_labeled_value (const char *label, uint64_t value)
>        if (high == 0)
>          _dl_printf ("%s=0x%x\n", label, low);
>        else
> -        _dl_printf ("%s=0x%x%08x\n", label, high, low);
> +        _dl_printf ("%s=0x%x%0*x\n", label, high, 8, low);
>      }
>  }
>  
> -- 
>
> 2.37.1

Looks okay to me.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian


      reply	other threads:[~2022-08-01 15:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-01 14:46 Andreas Schwab
2022-08-01 15:49 ` Florian Weimer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a68om0aa.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).