소스 검색

Make implicit conversion to size_t explicit

The code does the subtraction of two integers to determine the data
length. The data length is specified as size_t so an implicit
conversion is happening. This commit just makes that conversion
explicit.
Matt Clarkson 10 년 전
부모
커밋
2a71a1dd6f
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -7125,7 +7125,7 @@ static void read_websocket(struct mg_connection *conn,
 	while (!conn->ctx->stop_flag) {
 		header_len = 0;
 		assert(conn->data_len >= conn->request_len);
-		if ((body_len = conn->data_len - conn->request_len) >= 2) {
+		if ((body_len = (size_t)(conn->data_len - conn->request_len)) >= 2) {
 			len = buf[1] & 127;
 			mask_len = buf[1] & 128 ? 4 : 0;
 			if (len < 126 && body_len >= mask_len) {