Skip to content

Commit

Permalink
plugin: pass std::span to FileDescriptor::Read()
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Nov 13, 2024
1 parent 2e165eb commit fc1d71e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/plugin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@ void
PluginPipe::OnRead(unsigned) noexcept
{
char buffer[256];
ssize_t nbytes = socket_event.GetFileDescriptor().Read(buffer,
sizeof(buffer));
ssize_t nbytes = socket_event.GetFileDescriptor().Read(std::as_writable_bytes(std::span{buffer}));
if (nbytes <= 0) {
socket_event.Close();
cycle.OnEof();
Expand Down

0 comments on commit fc1d71e

Please sign in to comment.