aboutsummaryrefslogtreecommitdiff
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2015-02-12 15:01:37 -0800
committerMister Oyster <oysterized@gmail.com>2017-04-11 10:59:21 +0200
commit2308bc5917bfbd95a1f203f173e8c570e160a9b7 (patch)
tree849f7302d70d540bd3d81f136e241ba31af57c9a /lib/vsprintf.c
parente1a80ae35859cfc9bf0496091e6cf3fbdf0f3bad (diff)
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>
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index fc0e1f77d..c39116343 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1425,8 +1425,7 @@ qualifier:
case 'p':
spec->type = FORMAT_TYPE_PTR;
- return fmt - start;
- /* skip alnum */
+ return ++fmt - start;
case 'n':
spec->type = FORMAT_TYPE_NRCHARS;
@@ -1599,7 +1598,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
break;
case FORMAT_TYPE_PTR:
- str = pointer(fmt+1, str, end, va_arg(args, void *),
+ str = pointer(fmt, str, end, va_arg(args, void *),
spec);
while (isalnum(*fmt))
fmt++;
@@ -2066,7 +2065,7 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf)
}
case FORMAT_TYPE_PTR:
- str = pointer(fmt+1, str, end, get_arg(void *), spec);
+ str = pointer(fmt, str, end, get_arg(void *), spec);
while (isalnum(*fmt))
fmt++;
break;