diff options
| author | LLLL Colonq <llll@colonq> | 2026-09-29 17:34:12 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-09-29 17:34:12 -0400 |
| commit | 84f13229756b5a9253d7013ede8ed3a602ee5376 (patch) | |
| tree | 618c88ed27e9e528a6eeb52935baa1d55be0ee5d /pit/src/utils.c | |
| parent | 17df4b1ff7f4cbcf3b3218fea68f65d3cb60c984 (diff) | |
pit: Better double support
Diffstat (limited to 'pit/src/utils.c')
| -rw-r--r-- | pit/src/utils.c | 8 |
1 files changed, 3 insertions, 5 deletions
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 <lcq/pit/utils.h> +#include <stdio.h> + 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') } |
