2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-29 15:28:56 +00:00

vlog: fix the incorrect zero padding in format_log_message

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

Signed-off-by: zhangliping <zhangliping02@baidu.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
Tested-by: Mark Michelson <mmichels@redhat.com>
This commit is contained in:
zhangliping
2018-02-24 11:30:58 +08:00
committed by Ben Pfaff
parent 48b1008c0b
commit c9bc8c110e

View File

@@ -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 != '%') {