printk: fix wrong format string iter for printk
authorZhaolei <zhaolei@cn.fujitsu.com>
Fri, 27 Mar 2009 09:09:10 +0000 (17:09 +0800)
committerIngo Molnar <mingo@elte.hu>
Wed, 8 Apr 2009 15:03:44 +0000 (17:03 +0200)
printk("%Q");

 Output before patch:  %QQ
 Output  after patch:  %Q

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Acked-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: torvalds@linux-foundation.org
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <49CC97B6.7040809@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
lib/vsprintf.c

index be3001f912e4d906999242971f42146ebc07cc43..7536acea135ba4069c1dc04ad36d5024ac747d8c 100644 (file)
@@ -1051,13 +1051,6 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
                        if (str < end)
                                *str = '%';
                        ++str;
-                       if (*fmt) {
-                               if (str < end)
-                                       *str = *fmt;
-                               ++str;
-                       } else {
-                               --fmt;
-                       }
                        break;
 
                case FORMAT_TYPE_NRCHARS: {
@@ -1339,8 +1332,6 @@ do {                                                                      \
                        break;
 
                case FORMAT_TYPE_INVALID:
-                       if (!*fmt)
-                               --fmt;
                        break;
 
                case FORMAT_TYPE_NRCHARS: {
@@ -1523,13 +1514,6 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf)
                        if (str < end)
                                *str = '%';
                        ++str;
-                       if (*fmt) {
-                               if (str < end)
-                                       *str = *fmt;
-                               ++str;
-                       } else {
-                               --fmt;
-                       }
                        break;
 
                case FORMAT_TYPE_NRCHARS: