summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/firmware/efi/libstub/vsprintf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/firmware/efi/libstub/vsprintf.c b/drivers/firmware/efi/libstub/vsprintf.c
index fb9eb83f1728..00123d5f402f 100644
--- a/drivers/firmware/efi/libstub/vsprintf.c
+++ b/drivers/firmware/efi/libstub/vsprintf.c
@@ -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 */