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

Mark Michelson mmichels at redhat.com
Mon Feb 26 15:08:53 UTC 2018


Acked-by: Mark Michelson <mmichels at redhat.com>
Tested-by: Mark Michelson <mmichels at redhat.com>

On 02/23/2018 09:30 PM, zhangliping wrote:
> 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 != '%') {
> 



More information about the dev mailing list