Skip to content

Commit

Permalink
[Fix] clear buffer before reading again (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
manthanabc authored Jan 26, 2025
1 parent 967040a commit e8c830f
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 @@ -701,6 +701,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 e8c830f

Please sign in to comment.