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

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.edu


Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent 3b835095
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -279,10 +279,12 @@ 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 */
		qualifier = -1;