Commit 77e48db0 authored by Arvind Sankar's avatar Arvind Sankar Committed by Ard Biesheuvel

efi/printf: Fix minor bug in precision handling

A negative precision should be ignored completely, and the presence of a
valid precision should turn off the 0 flag.
Signed-off-by: default avatarArvind Sankar <nivedita@alum.mit.edu>
Link: https://lore.kernel.org/r/20200518190716.751506-10-nivedita@alum.mit.eduSigned-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent 3b835095
......@@ -279,9 +279,11 @@ int vsprintf(char *buf, const char *fmt, va_list args)
++fmt;
/* it's the next argument */
precision = va_arg(args, int);
}
if (precision < 0)
} else {
precision = 0;
}
if (precision >= 0)
flags &= ~ZEROPAD;
}
/* get the conversion qualifier */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment