diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-03 22:19:32 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-03 22:19:32 -0400 |
commit | 876970bcfd69ed3742d1a47640aa551578f22919 (patch) | |
tree | 2dddbc00f9ffccf687f1e5f1055e19b3939a73a3 /lib/printf.c | |
parent | add 64-bit idt/pic and fix paging (diff) | |
download | comus-876970bcfd69ed3742d1a47640aa551578f22919.tar.gz comus-876970bcfd69ed3742d1a47640aa551578f22919.tar.bz2 comus-876970bcfd69ed3742d1a47640aa551578f22919.zip |
load multiboot memory map, heap is done!!!
Diffstat (limited to 'lib/printf.c')
-rw-r--r-- | lib/printf.c | 10 |
1 files changed, 9 insertions, 1 deletions
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 <stddef.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> @@ -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': |