[PATCH master 30/39] efi: fix signed format specifier for uint64_t timestamp
Ahmad Fatoum
a.fatoum at pengutronix.de
Mon Feb 16 00:44:30 PST 2026
efi_set_variable_usec() uses %lld (signed) to format a uint64_t value.
Values above LLONG_MAX would be printed as negative numbers. Use %llu
to match the unsigned type.
Co-Authored-By: Claude Opus 4.6 <noreply at anthropic.com>
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
efi/efivar.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/efi/efivar.c b/efi/efivar.c
index 16c3228dc79b..c302ceec621e 100644
--- a/efi/efivar.c
+++ b/efi/efivar.c
@@ -82,7 +82,7 @@ int efi_set_variable_usec(char *name, efi_guid_t *vendor, uint64_t usec)
char buf[20];
wchar_t buf16[40];
- snprintf(buf, sizeof(buf), "%lld", usec);
+ snprintf(buf, sizeof(buf), "%llu", usec);
strcpy_char_to_wchar(buf16, buf);
return efi_set_variable(name, vendor,
--
2.47.3
More information about the barebox
mailing list