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 <[email protected]>
> ---
>  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
> [email protected]
> 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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to