浏览代码

Clean after merge

bel 9 年之前
父节点
当前提交
1dc88bc5ef
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/civetweb.c

+ 5 - 3
src/civetweb.c

@@ -1472,6 +1472,8 @@ mg_fopen(struct mg_connection *conn,
          const char *mode,
          const char *mode,
          struct file *filep)
          struct file *filep)
 {
 {
+	struct stat st;
+
 	if (!filep) {
 	if (!filep) {
 		return 0;
 		return 0;
 	}
 	}
@@ -1481,9 +1483,9 @@ mg_fopen(struct mg_connection *conn,
 	 * the same structure (bad cohesion). */
 	 * the same structure (bad cohesion). */
 	memset(filep, 0, sizeof(*filep));
 	memset(filep, 0, sizeof(*filep));
 
 
-	struct stat st;
-	if (stat(path, &st) == 0)
-		filep->size = st.st_size;
+	if (stat(path, &st) == 0) {
+		filep->size = (uint64_t)(st.st_size);
+	}
 
 
 	if (!is_file_in_memory(conn, path, filep)) {
 	if (!is_file_in_memory(conn, path, filep)) {
 #ifdef _WIN32
 #ifdef _WIN32