Explorar o código

Quick fix for files in memory (#382) (Step 5/?)

bel %!s(int64=8) %!d(string=hai) anos
pai
achega
c83dc314b0
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/civetweb.c

+ 2 - 2
src/civetweb.c

@@ -3666,7 +3666,7 @@ mg_stat(const struct mg_connection *conn,
 
 		/* Quick fix (for 1.9.x): */
 		/* mg_stat must fill all fields, also for files in memory */
-        struct mg_file tmp_file;
+        struct mg_file tmp_file = STRUCT_FILE_INITIALIZER;
 		open_file_in_memory(conn, path, &tmp_file, MG_FOPEN_MODE_NONE);
         filep->size = tmp_file.stat.size;
         filep->location = 2;
@@ -4190,7 +4190,7 @@ mg_stat(const struct mg_connection *conn,
 
 		/* Quick fix (for 1.9.x): */
 		/* mg_stat must fill all fields, also for files in memory */
-        struct mg_file tmp_file;
+        struct mg_file tmp_file = STRUCT_FILE_INITIALIZER;
 		open_file_in_memory(conn, path, &tmp_file, MG_FOPEN_MODE_NONE);
         filep->size = tmp_file.stat.size;
         filep->last_modified = time(NULL);