From 876970bcfd69ed3742d1a47640aa551578f22919 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Thu, 3 Apr 2025 22:19:32 -0400 Subject: load multiboot memory map, heap is done!!! --- lib/printf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/printf.c') diff --git a/lib/printf.c b/lib/printf.c index 4dbbd4b..d879c29 100644 --- a/lib/printf.c +++ b/lib/printf.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -389,7 +390,7 @@ static void do_printf(context_t *ctx, va_list args) char c; while (c = *fmt++, c != '\0') { // save start of fmt for current iteration - const char *start = fmt; + const char *start = fmt - 1; // ignore if not % if (c != '%') { @@ -422,6 +423,12 @@ static void do_printf(context_t *ctx, va_list args) // read data from args data_t data; switch (spec) { + case 'p': + opts.len = PRINTF_LEN_SIZE_T; + opts.width_set = true; + opts.radix = 16; + opts.hash = true; + opts.zero = true; case 'd': case 'i': case 'u': @@ -470,6 +477,7 @@ static void do_printf(context_t *ctx, va_list args) handle_int_specifier(ctx, &opts, true, data); break; // unsigned int + case 'p': case 'u': case 'o': case 'x': -- cgit v1.2.3-freya