Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a129cc2 authored by Adam Borowski's avatar Adam Borowski Committed by Petr Mladek
Browse files

vsprintf: avoid misleading "(null)" for %px

Like %pK already does, print "00000000" instead.

This confused people -- the convention is that "(null)" means you tried to
dereference a null pointer as opposed to printing the address.

Link: http://lkml.kernel.org/r/20180204174521.21383-1-kilobyte@angband.pl


To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Joe Perches <joe@perches.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: "Roberts, William C" <william.c.roberts@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Laight <David.Laight@ACULAB.COM>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarAdam Borowski <kilobyte@angband.pl>
Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
parent ab486bc9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1849,7 +1849,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
{
	const int default_width = 2 * sizeof(void *);

	if (!ptr && *fmt != 'K') {
	if (!ptr && *fmt != 'K' && *fmt != 'x') {
		/*
		 * Print (null) with the same width as a pointer so it makes
		 * tabular output look nice.