From a6810b0067772140320d49e46edb514cccc93b19 Mon Sep 17 00:00:00 2001 From: Manthan Patil Date: Sat, 4 Jan 2025 12:46:14 +0000 Subject: [PATCH] [Fix] clear buffer before reading again --- swhkd/src/daemon.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/swhkd/src/daemon.rs b/swhkd/src/daemon.rs index e23efe1..d5bfa5f 100644 --- a/swhkd/src/daemon.rs +++ b/swhkd/src/daemon.rs @@ -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)?; }