From 240eca0b68d27d57574f5f7cf8fd3f696a152646 Mon Sep 17 00:00:00 2001 From: Deomid Ryabkov Date: Mon, 14 Nov 2016 16:44:41 +0100 Subject: [PATCH] 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 --- mongoose.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mongoose.c b/mongoose.c index 11cdc0e7..321d5bc9 100644 --- a/mongoose.c +++ b/mongoose.c @@ -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);