mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 15:13:44 -04:00
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: Arvind Sankar <nivedita@alum.mit.edu> Link: https://lore.kernel.org/r/20200518190716.751506-10-nivedita@alum.mit.edu Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
committed by
Ard Biesheuvel
parent
3b8350959c
commit
77e48db04a
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user