1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-12-22 04:02:04 +03:00

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.
This commit is contained in:
Matt Clarkson
2015-07-15 21:45:27 +01:00
parent f8a93588c1
commit 2a71a1dd6f

View File

@@ -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) {