diff --git a/mongoose.c b/mongoose.c index df4a2959..d68a1508 100644 --- a/mongoose.c +++ b/mongoose.c @@ -692,7 +692,7 @@ void mg_http_printf_chunk(struct mg_connection *c, const char *fmt, ...) { } void mg_http_write_chunk(struct mg_connection *c, const char *buf, size_t len) { - mg_printf(c, "%X\r\n", len); + mg_printf(c, "%lX\r\n", (unsigned long) len); mg_send(c, buf, len); mg_send(c, "\r\n", 2); } diff --git a/src/http.c b/src/http.c index 0711fc8c..3e71d49d 100644 --- a/src/http.c +++ b/src/http.c @@ -270,7 +270,7 @@ void mg_http_printf_chunk(struct mg_connection *c, const char *fmt, ...) { } void mg_http_write_chunk(struct mg_connection *c, const char *buf, size_t len) { - mg_printf(c, "%X\r\n", len); + mg_printf(c, "%lX\r\n", (unsigned long) len); mg_send(c, buf, len); mg_send(c, "\r\n", 2); }