diff --git a/core/logic/sprintf.cpp b/core/logic/sprintf.cpp index 6263ddfb70..b872194f70 100644 --- a/core/logic/sprintf.cpp +++ b/core/logic/sprintf.cpp @@ -254,6 +254,12 @@ void AddFloat(char **buf_p, size_t &maxlen, double fval, int width, int prec, in return; } + if (ke::IsInfinite(static_cast(fval))) + { + AddString(buf_p, maxlen, "Inf", width, prec, flags | NOESCAPE); + return; + } + // default precision if (prec < 0) {