Browse Source

Fix: error: suggest parentheses around assignment used as truth value

Jochen Scheib 10 năm trước cách đây
mục cha
commit
e1917feb0d
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/civetweb.c

+ 2 - 2
src/civetweb.c

@@ -7287,8 +7287,8 @@ static int send_websocket_handshake(struct mg_connection *conn)
 	          "Sec-WebSocket-Accept: ",
 	          b64_sha,
 	          "\r\n");
-
-	if (protocol = mg_get_header(conn, "Sec-WebSocket-Protocol")) {
+	protocol = mg_get_header(conn, "Sec-WebSocket-Protocol");
+	if (protocol) {
 	mg_printf(conn,
 		"%s%s%s",
 		"Sec-WebSocket-Protocol:",