C89 compatibility for http-restful-server

This commit is contained in:
Sergey Lyubka 2024-07-27 07:01:48 +01:00
parent 09275ae4ca
commit a74fb940aa

View File

@ -82,7 +82,9 @@ static void fn(struct mg_connection *c, int ev, void *ev_data) {
mg_http_reply(c, 200, "", "{\"result\": \"%.*s\"}\n", hm->uri.len,
hm->uri.buf);
} else {
struct mg_http_serve_opts opts = {.root_dir = s_root_dir};
struct mg_http_serve_opts opts;
memset(&opts, 0, sizeof(opts));
opts.root_dir = s_root_dir;
mg_http_serve_dir(c, ev_data, &opts);
}
}