Skip to content
Snippets Groups Projects
Commit e5b3b8ad authored by Dmitry Frank's avatar Dmitry Frank Committed by Cesanta Bot
Browse files

Ensure not to overflow buf in udp server example

PUBLISHED_FROM=413f5073b0fc267d66ce04d8d40e9e9d7abac94d
parent e116c48b
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,7 @@ int main(int argc, char **argv) { ...@@ -79,7 +79,7 @@ int main(int argc, char **argv) {
mg_mgr_init(&mgr, NULL); mg_mgr_init(&mgr, NULL);
{ {
char listen[256]; char listen[256];
sprintf(listen, "udp://%s", port); snprintf(listen, sizeof(listen), "udp://%s", port);
nc = mg_bind(&mgr, listen, ev_handler); nc = mg_bind(&mgr, listen, ev_handler);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment