diff --git a/mongoose.c b/mongoose.c index edd1074c..890e622f 100644 --- a/mongoose.c +++ b/mongoose.c @@ -3314,7 +3314,7 @@ size_t mg_printf(struct mg_connection *c, const char *fmt, ...) { } char *mg_straddr(struct mg_addr *a, char *buf, size_t len) { - char tmp[30]; + char tmp[40]; const char *fmt = a->is_ip6 ? "[%s]:%d" : "%s:%d"; mg_ntoa(a, tmp, sizeof(tmp)); mg_snprintf(buf, len, fmt, tmp, (int) mg_ntohs(a->port)); diff --git a/src/net.c b/src/net.c index b5ece99e..4562f5d6 100644 --- a/src/net.c +++ b/src/net.c @@ -21,7 +21,7 @@ size_t mg_printf(struct mg_connection *c, const char *fmt, ...) { } char *mg_straddr(struct mg_addr *a, char *buf, size_t len) { - char tmp[30]; + char tmp[40]; const char *fmt = a->is_ip6 ? "[%s]:%d" : "%s:%d"; mg_ntoa(a, tmp, sizeof(tmp)); mg_snprintf(buf, len, fmt, tmp, (int) mg_ntohs(a->port));