Do not report error if mg_printf() printed 0 bytes

This commit is contained in:
Sergey Lyubka committed 2012-09-13 21:58:37 +01:00
1 parent 3f4be595a6
commit 8072b0a7d4
1 file changed
+3 -1
+3 -1
View File
@@ -1492,7 +1492,9 @@ int mg_printf(struct mg_connection *conn, const char *fmt, ...) {
len = vsnprintf(mem, sizeof(mem), fmt, 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
len = -1;
cry(conn, "%s(%s, ...): vsnprintf() error", __func__, fmt);