From 997da11cc5f612957f9cf8bd0f4f92a9479a9e1e Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Mon, 30 Jan 2023 16:59:14 -0300 Subject: [PATCH] do not use %I --- examples/http-restful-server/main.c | 4 ++-- examples/zephyr/http-server/src/main.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/http-restful-server/main.c b/examples/http-restful-server/main.c index 8dabcb11..af67a9bd 100644 --- a/examples/http-restful-server/main.c +++ b/examples/http-restful-server/main.c @@ -35,12 +35,12 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { mg_printf(c, "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n"); mg_http_printf_chunk(c, "ID PROTO TYPE LOCAL REMOTE\n"); for (struct mg_connection *t = c->mgr->conns; t != NULL; t = t->next) { - mg_http_printf_chunk(c, "%-3lu %4s %s %I %I\n", t->id, + mg_http_printf_chunk(c, "%-3lu %4s %s %M %M\n", t->id, t->is_udp ? "UDP" : "TCP", t->is_listening ? "LISTENING" : t->is_accepted ? "ACCEPTED " : "CONNECTED", - 4, &t->loc.ip, 4, &t->rem.ip); + mg_print_ip, &t->loc, mg_print_ip, &t->rem); } mg_http_printf_chunk(c, ""); // Don't forget the last empty chunk } else if (mg_http_match_uri(hm, "/api/f2/*")) { diff --git a/examples/zephyr/http-server/src/main.c b/examples/zephyr/http-server/src/main.c index 79b4d9d3..837b87d6 100644 --- a/examples/zephyr/http-server/src/main.c +++ b/examples/zephyr/http-server/src/main.c @@ -24,12 +24,12 @@ static void wcb(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { mg_printf(c, "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n"); mg_http_printf_chunk(c, "ID PROTO TYPE LOCAL REMOTE\n"); for (struct mg_connection *t = c->mgr->conns; t != NULL; t = t->next) { - mg_http_printf_chunk(c, "%-3lu %4s %s %I %I\n", t->id, + mg_http_printf_chunk(c, "%-3lu %4s %s %M %M\n", t->id, t->is_udp ? "UDP" : "TCP", t->is_listening ? "LISTENING" : t->is_accepted ? "ACCEPTED " : "CONNECTED", - 4, &t->loc.ip, 4, &t->rem.ip); + mg_print_ip, &t->loc, mg_print_ip, &t->rem); } mg_http_printf_chunk(c, ""); // Don't forget the last empty chunk } else {