mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-04 21:58:22 +00:00
Do not report error if mg_printf() printed 0 bytes
This commit is contained in:
1 parent
3f4be595a6
commit
8072b0a7d4
1 file changed
+3
-1
+3
-1
@@ -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);
|
||||||
|
|||||||
Reference in new issue
Block a user