diff options
author | Omar Polo <op@omarpolo.com> | 2024-07-08 20:06:02 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2024-07-08 20:06:02 +0000 |
commit | 0d1db30fbddbbc032b252b58a003ca3171016ff8 (patch) | |
tree | 9c7690387f3d872e2814d3e3457eb7d0fdbdd269 | |
parent | 502817ef1461c78e8bbac34a4e5b33e17f1a84fd (diff) |
fix left computation
-rw-r--r-- | server.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1310,7 +1310,7 @@ read_cb(struct tls *ctx, void *buf, size_t buflen, void *cb_arg) if (c->buf.has_tail) { /* we have leftover data from a previous call to read_cb */ - size_t left = BUFLAYER_MAX - c->buf.read_pos; + size_t left = c->buf.len - c->buf.read_pos; size_t copy_len = MINIMUM(buflen, left); memcpy(buf, c->buf.data + c->buf.read_pos, copy_len); |