From 3174bc405f007d2233fb76a21b4308278fbd9111 Mon Sep 17 00:00:00 2001 From: LinlyBoi Date: Tue, 22 Aug 2023 14:04:54 +0300 Subject: [PATCH] decided where to init the indexes --- printf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/printf.c b/printf.c index f6df54a..636e6ab 100644 --- a/printf.c +++ b/printf.c @@ -24,6 +24,8 @@ int _printf(const char *format, ...) if (!format) /* No string. No laundry */ return (0); + buff_idx = 0; + fmt_idx = 0; while (*(format + fmt_idx)) { if ((*(format + fmt_idx) == '%') && (*(format + fmt_idx + 1)))