Skip to content

Commit

Permalink
fix random fatal error in socket:recv
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailRis committed Dec 4, 2024
1 parent c9fdc04 commit 458186d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/logic/scripting/lua/libs/libnetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ static int l_recv(lua::State* L) {
if (connection == nullptr) {
return 0;
}
util::Buffer<char> buffer(glm::min(length, connection->available()));
length = glm::min(length, connection->available());
util::Buffer<char> buffer(length);

int size = connection->recv(buffer.data(), length);
if (size == -1) {
Expand Down

0 comments on commit 458186d

Please sign in to comment.