diff --git a/src/networking.c b/src/networking.c index 13b76a089..915a0b016 100644 --- a/src/networking.c +++ b/src/networking.c @@ -2092,7 +2092,7 @@ int _writeToClient(client *c) { ssize_t tot_written = 0; while (tot_written < bytes_to_write) { - int nwritten = connWrite(c->conn, c->buf + c->sentlen, bytes_to_write - tot_written); + int nwritten = connWrite(c->conn, c->buf + c->sentlen + tot_written, bytes_to_write - tot_written); if (nwritten <= 0) { c->write_flags |= WRITE_FLAGS_WRITE_ERROR; tot_written = tot_written > 0 ? tot_written : nwritten;