From f0c6aad8cfd6ac280fbe2a757cc5490ded7491ad Mon Sep 17 00:00:00 2001 From: josesimoes Date: Mon, 16 Sep 2024 10:53:42 +0100 Subject: [PATCH] Porting changes from charlesnicholson/nanoprintf#274 --- src/CLR/Helpers/nanoprintf/nanoprintf.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CLR/Helpers/nanoprintf/nanoprintf.h b/src/CLR/Helpers/nanoprintf/nanoprintf.h index 1746093068..986d145ca9 100644 --- a/src/CLR/Helpers/nanoprintf/nanoprintf.h +++ b/src/CLR/Helpers/nanoprintf/nanoprintf.h @@ -996,7 +996,10 @@ int npf_vpprintf(npf_putc pc, void *pc_ctx, char const *format, va_list args) { if (fs.conv_spec != NPF_FMT_SPEC_CONV_STRING) { #if NANOPRINTF_USE_FLOAT_FORMAT_SPECIFIERS == 1 // float precision is after the decimal point - if (fs.conv_spec != NPF_FMT_SPEC_CONV_FLOAT_DEC) + if ((fs.conv_spec != NPF_FMT_SPEC_CONV_FLOAT_DEC) && + (fs.conv_spec != NPF_FMT_SPEC_CONV_FLOAT_SCI) && + (fs.conv_spec != NPF_FMT_SPEC_CONV_FLOAT_SHORTEST) && + (fs.conv_spec != NPF_FMT_SPEC_CONV_FLOAT_HEX)) #endif { prec_pad = npf_max(0, fs.prec - cbuf_len); } }