diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2015-02-12 15:01:37 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-12 18:54:13 -0800 |
commit | ffbfed03b4bdd229b99c2611f5ace1fbc912caaa (patch) | |
tree | bb3f9fdb1d2d2aff388dd1fb18bde0fdde947744 | |
parent | 205bd3d23e938530cb89ff9e14afda389ac85dc3 (diff) | |
download | op-kernel-dev-ffbfed03b4bdd229b99c2611f5ace1fbc912caaa.zip op-kernel-dev-ffbfed03b4bdd229b99c2611f5ace1fbc912caaa.tar.gz |
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>
-rw-r--r-- | lib/vsprintf.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index ec337f64..98ad170 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1604,8 +1604,7 @@ qualifier: case 'p': spec->type = FORMAT_TYPE_PTR; - return fmt - start; - /* skip alnum */ + return ++fmt - start; case '%': spec->type = FORMAT_TYPE_PERCENT_CHAR; @@ -1794,7 +1793,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++; @@ -2232,7 +2231,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; |