mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-14 22:44:27 +08: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:
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 */
|
||||
|
Loading…
Reference in New Issue
Block a user