瀏覽代碼

Avoid Memory Sanitizer warning

Fixes #1154
bel2125 2 年之前
父節點
當前提交
ac00b3bec3
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      src/civetweb.c

+ 3 - 4
src/civetweb.c

@@ -2325,7 +2325,7 @@ STOP_FLAG_IS_TWO(stop_flag_t *f)
 static void
 STOP_FLAG_ASSIGN(stop_flag_t *f, stop_flag_t v)
 {
-	stop_flag_t sf;
+	stop_flag_t sf = 0;
 	do {
 		sf = mg_atomic_compare_and_swap(f, *f, v);
 	} while (sf != v);
@@ -9528,9 +9528,8 @@ connect_socket(
 		/* Data for poll */
 		struct mg_pollfd pfd[1];
 		int pollres;
-		int ms_wait = 10000; /* 10 second timeout */
-		stop_flag_t nonstop;
-		STOP_FLAG_ASSIGN(&nonstop, 0);
+		int ms_wait = 10000;     /* 10 second timeout */
+		stop_flag_t nonstop = 0; /* STOP_FLAG_ASSIGN(&nonstop, 0); */
 
 		/* For a non-blocking socket, the connect sequence is:
 		 * 1) call connect (will not block)