mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yury Norov <yury.norov@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Cc: Yury Norov <yury.norov@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Petr Mladek <pmladek@suse.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Steven Rostedt <rostedt@goodmis.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: [PATCH] lib/vsprintf: don't increment buf in bitmap_list_string
Date: Tue, 17 Aug 2021 12:37:35 -0700	[thread overview]
Message-ID: <20210817193735.269942-1-yury.norov@gmail.com> (raw)

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@gmail.com>
Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
 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


             reply	other threads:[~2021-08-17 19:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 19:37 Yury Norov [this message]
2021-08-18  9:17 ` Andy Shevchenko
2021-08-18 19:36   ` Andrew Morton
2021-08-18 20:10     ` Yury Norov
2021-08-19  9:35       ` Sergey Senozhatsky

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=20210817193735.269942-1-yury.norov@gmail.com \
    --to=yury.norov@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=sfr@canb.auug.org.au \
    /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

all inboxes | Powered by JetHome®