Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lib/vsprintf.c: consume 'p' in format_decode

It seems a little simpler to consume the p from a %p specifier in
format_decode, just as it is done for the surrounding %c, %s and %% cases.

While there, delete a redundant and misplaced comment.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Rasmus Villemoes and committed by
Linus Torvalds
ffbfed03 205bd3d2

+3 -4
+3 -4
lib/vsprintf.c
··· 1604 1604 1605 1605 case 'p': 1606 1606 spec->type = FORMAT_TYPE_PTR; 1607 - return fmt - start; 1608 - /* skip alnum */ 1607 + return ++fmt - start; 1609 1608 1610 1609 case '%': 1611 1610 spec->type = FORMAT_TYPE_PERCENT_CHAR; ··· 1793 1794 break; 1794 1795 1795 1796 case FORMAT_TYPE_PTR: 1796 - str = pointer(fmt+1, str, end, va_arg(args, void *), 1797 + str = pointer(fmt, str, end, va_arg(args, void *), 1797 1798 spec); 1798 1799 while (isalnum(*fmt)) 1799 1800 fmt++; ··· 2231 2232 } 2232 2233 2233 2234 case FORMAT_TYPE_PTR: 2234 - str = pointer(fmt+1, str, end, get_arg(void *), spec); 2235 + str = pointer(fmt, str, end, get_arg(void *), spec); 2235 2236 while (isalnum(*fmt)) 2236 2237 fmt++; 2237 2238 break;