summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@novell.com>2011-05-24 17:13:18 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 08:39:47 -0700
commitd9be9b90d6dc5e712ca5d6109691a8de753ce7f1 (patch)
tree1ba560ac75dd1a2575ee5ec95f91a9d549467361
parent746a2a838deec3ef86ef6b7c3edd4207b9a351aa (diff)
lib/vsprintf.c: fix interaction of kasprintf() and vsnprintf() when using %pV
Otherwise, the warning at the top of vsnprintf() gets triggered by kvasprintf()'s first invocation (with NULL buffer and zero size) of vsnprintf(). Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--lib/vsprintf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 1d659d7bb0f..c11205688fb 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -898,7 +898,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
case 'U':
return uuid_string(buf, end, ptr, spec, fmt);
case 'V':
- return buf + vsnprintf(buf, end - buf,
+ return buf + vsnprintf(buf, end > buf ? end - buf : 0,
((struct va_format *)ptr)->fmt,
*(((struct va_format *)ptr)->va));
case 'K':