Skip to content

Commit

Permalink
[Fix] clear buffer before reading again
Browse files Browse the repository at this point in the history
  • Loading branch information
manthanabc committed Jan 4, 2025
1 parent 5f391b5 commit a6810b0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions swhkd/src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,9 @@ pub fn refresh_env(
log::error!("Failed to write to socket.");
return Ok((None, prev_hash));
}

// Clear the buffer before reading
buff.clear();
stream.read_to_string(&mut buff)?;
}

Expand Down

0 comments on commit a6810b0

Please sign in to comment.