Skip to content

Commit 865f4a4

Browse files
committed
Assume output strings are longer than their source byte sequences
1 parent 1291fb9 commit 865f4a4

File tree

1 file changed

+4
-1
lines changed
  • espflash/src/cli/monitor

1 file changed

+4
-1
lines changed

espflash/src/cli/monitor/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ fn try_parse_mixed(process: &mut impl FnMut(FrameKind<'_>), table: &Table, frame
158158
let is_valid_frame = |frame_bytes| {
159159
let mut decoder = table.new_stream_decoder();
160160
decoder.received(frame_bytes);
161-
decoder.decode().is_ok()
161+
match decoder.decode() {
162+
Ok(frame) => frame.display_message().to_string().len() > frame_bytes.len(),
163+
Err(_) => false,
164+
}
162165
};
163166

164167
let assume_text = |frame_bytes: &[u8]| {

0 commit comments

Comments
 (0)