[ovs-dev] [PATCH] vlog: fix the incorrect zero padding in format_log_message

zhangliping zhanglkk1990 at 163.com
Sat Feb 24 03:30:58 UTC 2018


From: zhangliping <zhangliping02 at baidu.com>

If the format specifier does not have the 0 flag, we should pad with
blanks instead of zeroes.

Signed-off-by: zhangliping <zhangliping02 at baidu.com>
---
 lib/vlog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/vlog.c b/lib/vlog.c
index f28695043..0e862a773 100644
--- a/lib/vlog.c
+++ b/lib/vlog.c
@@ -952,7 +952,7 @@ format_log_message(const struct vlog_module *module, enum vlog_level level,
     for (p = pattern; *p != '\0'; ) {
         const char *subprogram_name;
         enum { LEFT, RIGHT } justify = RIGHT;
-        int pad = '0';
+        int pad = ' ';
         size_t length, field, used;
 
         if (*p != '%') {
-- 
2.13.4




More information about the dev mailing list