Avoid passing NULL to %.*s

CC3200 (TI's C library) doesn't like it

https://e2e.ti.com/support/development_tools/compiler/f/343/t/554883

PUBLISHED_FROM=d0e9fb7ebb7d189d1a76451d609f1f1861c7a837
This commit is contained in:
Deomid Ryabkov
2016-11-14 16:20:08 +00:00
committed by Cesanta Bot
parent cd54b18de3
commit 240eca0b68
+2 -1
View File
@@ -7431,7 +7431,8 @@ struct mg_connection *mg_connect_http_opt(struct mg_mgr *mgr,
mg_printf(nc, "%s %s HTTP/1.1\r\nHost: %s\r\nContent-Length: %" SIZE_T_FMT
"\r\n%.*s%s\r\n%s",
post_data == NULL ? "GET" : "POST", path, addr,
post_data == NULL ? 0 : strlen(post_data), (int) auth.len, auth.buf,
post_data == NULL ? 0 : strlen(post_data),
(int) auth.len, (auth.buf == NULL ? "" : auth.buf),
extra_headers == NULL ? "" : extra_headers,
post_data == NULL ? "" : post_data);