diff --git a/mongoose.c b/mongoose.c index 587422d3..a92ee7b7 100644 --- a/mongoose.c +++ b/mongoose.c @@ -7604,7 +7604,7 @@ static void mg_scan_directory(struct mg_connection *nc, const char *dir, const struct mg_serve_http_opts *opts, void (*func)(struct mg_connection *, const char *, cs_stat_t *)) { - char path[MG_MAX_PATH]; + char path[MG_MAX_PATH + 1]; cs_stat_t st; struct dirent *dp; DIR *dirp; diff --git a/src/mg_http.c b/src/mg_http.c index 9f456856..257bde4c 100644 --- a/src/mg_http.c +++ b/src/mg_http.c @@ -2026,7 +2026,7 @@ static void mg_scan_directory(struct mg_connection *nc, const char *dir, const struct mg_serve_http_opts *opts, void (*func)(struct mg_connection *, const char *, cs_stat_t *)) { - char path[MG_MAX_PATH]; + char path[MG_MAX_PATH + 1]; cs_stat_t st; struct dirent *dp; DIR *dirp;