From 3f59011518efce44cb84cb2009bc647801818f10 Mon Sep 17 00:00:00 2001 From: creationship27 Date: Wed, 3 Aug 2022 15:29:30 +0000 Subject: [PATCH] Added support for %i option. --- README.md | 2 +- uefi/stdio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 37b1c27..2f4172e 100644 --- a/README.md +++ b/README.md @@ -231,7 +231,7 @@ Sets an environment variable by `name` with `data` of length `len`. On success r | getchar_ifany | non-blocking, returns 0 if there was no key press, UNICODE otherwise | | putchar | as usual, stdout only (no stream redirects) | -String formating is limited; only supports padding via positive number prefixes, `%d`, `%x`, `%X`, `%c`, `%s`, `%q` and +String formating is limited; only supports padding via positive number prefixes, `%d`, `%i`, `%x`, `%X`, `%c`, `%s`, `%q` and `%p` (no `%e`, `%f`, `%g`, no asterisk and dollar). When `UEFI_NO_UTF8` is defined, then formating operates on wchar_t, so it also supports the non-standard `%S` (printing an UTF-8 string) and `%Q` (printing an escaped UTF-8 string). These functions don't allocate memory, but in return the total length of the output string cannot be longer than `BUFSIZ` diff --git a/uefi/stdio.c b/uefi/stdio.c index 886c735..b6c16fc 100644 --- a/uefi/stdio.c +++ b/uefi/stdio.c @@ -544,7 +544,7 @@ int vsnprintf(char_t *dst, size_t maxlen, const char_t *fmt, __builtin_va_list a fmt++; continue; } else - if(*fmt==CL('d')) { + if(*fmt==CL('d') || *fmt==CL('i')) { arg = __builtin_va_arg(args, int64_t); sign=0; if(arg<0) {