Explorar el Código

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

Jochen Scheib hace 10 años
padre
commit
e1917feb0d
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  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: ",
 	          "Sec-WebSocket-Accept: ",
 	          b64_sha,
 	          b64_sha,
 	          "\r\n");
 	          "\r\n");
-
-	if (protocol = mg_get_header(conn, "Sec-WebSocket-Protocol")) {
+	protocol = mg_get_header(conn, "Sec-WebSocket-Protocol");
+	if (protocol) {
 	mg_printf(conn,
 	mg_printf(conn,
 		"%s%s%s",
 		"%s%s%s",
 		"Sec-WebSocket-Protocol:",
 		"Sec-WebSocket-Protocol:",