diff --git a/tutorials/http/http-restful-server/main.c b/tutorials/http/http-restful-server/main.c index d32f571f..28c2548e 100644 --- a/tutorials/http/http-restful-server/main.c +++ b/tutorials/http/http-restful-server/main.c @@ -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); } }