[PATCH] lib/vsprintf: don't increment buf in bitmap_list_string

From: Yury Norov
Date: Tue Aug 17 2021 - 15:37:49 EST


Increment is confusing as the buf is overritten at the same line.

Fixes: b1c4af4d3d6b (vsprintf: rework bitmap_list_string) (next-20210817)
Suggested-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
Signed-off-by: Yury Norov <yury.norov@xxxxxxxxx>
---
lib/vsprintf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 29a384eee286..919b70d00855 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1261,7 +1261,7 @@ char *bitmap_list_string(char *buf, char *end, unsigned long *bitmap,

if (buf < end)
*buf = '-';
- buf = number(++buf, end, rtop - 1, default_dec_spec);
+ buf = number(buf + 1, end, rtop - 1, default_dec_spec);
}
return buf;
}
--
2.30.2