From b0880daaa332f3cc26d6f6db8a4e63cc8aa01b66 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 4 Apr 2019 20:37:11 -0700 Subject: [PATCH] Implement octal printing. --- lib/printfmt.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/printfmt.c b/lib/printfmt.c index 802adcd..b1de635 100644 --- a/lib/printfmt.c +++ b/lib/printfmt.c @@ -205,11 +205,9 @@ vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap) // (unsigned) octal case 'o': - // LAB 1: Replace this with your code. - putch('X', putdat); - putch('X', putdat); - putch('X', putdat); - break; + num = getuint(&ap, lflag); + base = 8; + goto number; // pointer case 'p':