diff --git a/src/debug.cpp b/src/debug.cpp index 328d93bad..fe1d90e25 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -107,10 +107,7 @@ int log_vprintf(int level, const char *format, va_list ap) buf.append(size + 1, '\0'); va_copy(aq, ap); - if (vsnprintf(buf.data() + style.length(), size + 1, format, ap) != size) { - va_end(aq); - return 0; - } + vsnprintf(buf.data() + style.length(), size + 1, format, ap); va_end(aq); auto & str = buf.get(); str.resize(str.size() - 1); // drop '\0' written by vsnprintf diff --git a/src/utils/color_out.cpp b/src/utils/color_out.cpp index 18e13fe18..a4b469587 100644 --- a/src/utils/color_out.cpp +++ b/src/utils/color_out.cpp @@ -205,7 +205,7 @@ int color_printf(const char *format, ...) { auto buf = get_log_output().get_buffer(); buf.append(size + 1, '\0'); va_start(ap, format); - size = vsnprintf(buf.data(), size + 1, format, ap); + vsnprintf(buf.data(), size + 1, format, ap); va_end(ap); if (!color_stdout) {