Explorar o código

Quick fix for #244

Later mg_fopen and mg_stat should be restructured, so the do not work on different members of the same structure.
bel %!s(int64=9) %!d(string=hai) anos
pai
achega
de5c287ad6
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/civetweb.c

+ 4 - 1
src/civetweb.c

@@ -1476,7 +1476,10 @@ mg_fopen(struct mg_connection *conn,
 		return 0;
 	}
 
-	memset(filep, 0, sizeof(*filep));
+	/* TODO (high): mg_fopen should only open a file, while mg_stat should
+	 * only get the file status. They should not work on different members of
+	 * the same structure (bad cohesion). */
+	/* memset(filep, 0, sizeof(*filep)); <-- remove this (issue #244) */
 
 	if (!is_file_in_memory(conn, path, filep)) {
 #ifdef _WIN32