From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] fixup! vsprintf: add optional support for %ls format modifier
Date: Mon, 13 Dec 2021 23:19:50 +0100 [thread overview]
Message-ID: <20211213221950.GI6003@pengutronix.de> (raw)
In-Reply-To: <20211209105841.3518522-1-a.fatoum@pengutronix.de>
On Thu, Dec 09, 2021 at 11:58:41AM +0100, Ahmad Fatoum wrote:
> -- has higher operator precedence than *, so instead of decreasing
> field_width, the pointer was decremented. This lead to misalignment,
> e.g. when doing of_dump. Fix this up.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> lib/vsprintf.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks
Sascha
>
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index ce92787c58ef..9a94a1bbe84e 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -153,7 +153,7 @@ static char *leading_spaces(char *buf, const char *end,
> int len, int *field_width, int flags)
> {
> if (!(flags & LEFT)) {
> - while (len < *field_width--) {
> + while (len < (*field_width)--) {
> if (buf < end)
> *buf = ' ';
> ++buf;
> @@ -166,7 +166,7 @@ static char *leading_spaces(char *buf, const char *end,
> static char *trailing_spaces(char *buf, const char *end,
> int len, int *field_width, int flags)
> {
> - while (len < *field_width--) {
> + while (len < (*field_width)--) {
> if (buf < end)
> *buf = ' ';
> ++buf;
> --
> 2.30.2
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2021-12-13 22:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-09 10:58 Ahmad Fatoum
2021-12-13 22:19 ` Sascha Hauer [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=20211213221950.GI6003@pengutronix.de \
--to=sha@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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