Commit 8072b0a7 authored by Sergey Lyubka's avatar Sergey Lyubka

Do not report error if mg_printf() printed 0 bytes

parent 3f4be595
...@@ -1492,7 +1492,9 @@ int mg_printf(struct mg_connection *conn, const char *fmt, ...) { ...@@ -1492,7 +1492,9 @@ int mg_printf(struct mg_connection *conn, const char *fmt, ...) {
len = vsnprintf(mem, sizeof(mem), fmt, ap); len = vsnprintf(mem, sizeof(mem), fmt, ap);
va_end(ap); va_end(ap);
if (len <= 0) { if (len == 0) {
// Do nothing. mg_printf(conn, "%s", "") was called.
} else if (len < 0) {
// vsnprintf() error, give up // vsnprintf() error, give up
len = -1; len = -1;
cry(conn, "%s(%s, ...): vsnprintf() error", __func__, fmt); cry(conn, "%s(%s, ...): vsnprintf() error", __func__, fmt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment