Ensure not to overflow buf in udp server example

PUBLISHED_FROM=413f5073b0fc267d66ce04d8d40e9e9d7abac94d
This commit is contained in:
Dmitry Frank authored and Cesanta Bot committed 2018-01-30 20:39:50 +00:00
1 parent e116c48bef
commit e5b3b8ad32
1 file changed
+1 -1
+1 -1
View File
@@ -79,7 +79,7 @@ int main(int argc, char **argv) {
mg_mgr_init(&mgr, NULL);
{
char listen[256];
sprintf(listen, "udp://%s", port);
snprintf(listen, sizeof(listen), "udp://%s", port);
nc = mg_bind(&mgr, listen, ev_handler);
}