diff --git a/core/sm_stringutil.cpp b/core/sm_stringutil.cpp index 26539e4b..2cb3bfef 100644 --- a/core/sm_stringutil.cpp +++ b/core/sm_stringutil.cpp @@ -281,7 +281,7 @@ void AddFloat(char **buf_p, size_t &maxlen, double fval, int width, int prec, in } // write the fraction part - if (maxlen) + if (maxlen && prec) { *buf++ = '.'; maxlen--;