aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@novell.com>2011-05-24 20:13:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 11:39:47 -0400
commitd9be9b90d6dc5e712ca5d6109691a8de753ce7f1 (patch)
tree1ba560ac75dd1a2575ee5ec95f91a9d549467361 /lib
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/vsprintf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 1d659d7bb0f8..c11205688fb4 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -898,7 +898,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
898 case 'U': 898 case 'U':
899 return uuid_string(buf, end, ptr, spec, fmt); 899 return uuid_string(buf, end, ptr, spec, fmt);
900 case 'V': 900 case 'V':
901 return buf + vsnprintf(buf, end - buf, 901 return buf + vsnprintf(buf, end > buf ? end - buf : 0,
902 ((struct va_format *)ptr)->fmt, 902 ((struct va_format *)ptr)->fmt,
903 *(((struct va_format *)ptr)->va)); 903 *(((struct va_format *)ptr)->va));
904 case 'K': 904 case 'K':