Explorar o código

The cast of buffered_len to size_t should not be needed (jimevans, issue #36)

bel %!s(int64=10) %!d(string=hai) anos
pai
achega
33b6b1419f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -2292,7 +2292,7 @@ int mg_read(struct mg_connection *conn, void *buf, size_t len)
         body = conn->buf + conn->request_len + conn->consumed_content;
         buffered_len = (int64_t)(&conn->buf[conn->data_len] - body);
         if (buffered_len > 0) {
-            if (len64 < (size_t) buffered_len) {
+            if (len64 < buffered_len) {
                 buffered_len = len64;
             }
             memcpy(buf, body, (size_t) buffered_len);