Switch to read_exact in tp-link telnet_send_command

This commit is contained in:
Sashanoraa
2025-04-25 19:49:25 -04:00
committed by Cooper Quintin
parent 894f457751
commit c97212cdc8

View File

@@ -144,9 +144,11 @@ async fn telnet_send_command(
let (mut reader, mut writer) = stream.into_split(); let (mut reader, mut writer) = stream.into_split();
loop { loop {
let mut buf = [0]; let mut next_byte = 0;
reader.read(&mut buf).await?; reader
if buf[0] == b'#' { .read_exact(std::slice::from_mut(&mut next_byte))
.await?;
if next_byte == b'#' {
break; break;
} }
} }