C++ 17 related fix, using DBL_DECIMAL_DIG instead of DECIMAL_DIG

This commit is contained in:
Gulliver
2025-10-12 12:29:00 +02:00
parent 57b42536ee
commit 4095ab29b3

View File

@@ -1876,9 +1876,9 @@ namespace crow // NOTE: Already documented in "crow/app.h"
if (v.nt == num_type::Double_precision_floating_point)
{
#ifdef _MSC_VER
sprintf_s(outbuf, sizeof(outbuf), "%.*g", DECIMAL_DIG, v.num.d);
sprintf_s(outbuf, sizeof(outbuf), "%.*g", DBL_DECIMAL_DIG, v.num.d);
#else
snprintf(outbuf, sizeof(outbuf), "%.*g", DECIMAL_DIG, v.num.d);
snprintf(outbuf, sizeof(outbuf), "%.*g", DBL_DECIMAL_DIG, v.num.d);
#endif
}
else