From d690e2e5f5fddfad15ff71b42a94d253fb7b80f2 Mon Sep 17 00:00:00 2001 From: Anders Dalskov Date: Wed, 20 Aug 2025 23:04:55 +0200 Subject: [PATCH 1/2] only adjust pointers on the happy path. --- include/scl/net/tcp_channel.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/scl/net/tcp_channel.h b/include/scl/net/tcp_channel.h index 6183a11..e6dd72e 100644 --- a/include/scl/net/tcp_channel.h +++ b/include/scl/net/tcp_channel.h @@ -151,10 +151,10 @@ coro::Task TcpChannel::send(const Packet& packet) { } else { throw std::system_error(err, std::generic_category(), "send failed"); } + } else { + rem -= written; + data += written; } - - rem -= written; - data += written; } } @@ -178,10 +178,10 @@ coro::Task recvInto(SocketType socket, } else { throw std::system_error(err, std::generic_category(), "recv failed"); } + } else { + rem -= read; + dst += read; } - - rem -= read; - dst += read; } } From ad561df8d62083b90677f2207e7f9131986dc84f Mon Sep 17 00:00:00 2001 From: Anders Dalskov Date: Wed, 20 Aug 2025 23:07:59 +0200 Subject: [PATCH 2/2] remove spurious semicolon --- include/scl/math/array.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/scl/math/array.h b/include/scl/math/array.h index 6cbf53f..667de38 100644 --- a/include/scl/math/array.h +++ b/include/scl/math/array.h @@ -135,7 +135,7 @@ class Array final { * This function will attempt to construct a \p T element using \p value, and * then fill all slots with this value. */ - explicit Array(int value) : Array(T{value}) {}; + explicit Array(int value) : Array(T{value}) {} /** * @brief Copy construct an Array from another array.