From 84f13229756b5a9253d7013ede8ed3a602ee5376 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 29 Sep 2026 17:34:12 -0400 Subject: pit: Better double support --- pit/src/utils.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'pit/src/utils.c') diff --git a/pit/src/utils.c b/pit/src/utils.c index ac8087c..7bbad10 100644 --- a/pit/src/utils.c +++ b/pit/src/utils.c @@ -1,5 +1,7 @@ #include +#include + enum vsnprintf_mode { VSNPRINTF_MODE_NORMAL, VSNPRINTF_MODE_FLAGS, @@ -55,11 +57,7 @@ int pit_vsnprintf_helper( break; } case 'f': { - double arg = 0.0; - if (length_mod == 'l') - arg = va_arg(ap, double); - else - arg = va_arg(ap, double); + double arg = arg = va_arg(ap, double); long wholepart = (long) arg; double fracpart = arg - (double) wholepart; if (wholepart == 0) { WRITE('0') } -- cgit v1.3.1