Skip to content

Commit

Permalink
Assume output strings are longer than their source byte sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Aug 26, 2023
1 parent 1291fb9 commit 865f4a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion espflash/src/cli/monitor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ fn try_parse_mixed(process: &mut impl FnMut(FrameKind<'_>), table: &Table, frame
let is_valid_frame = |frame_bytes| {
let mut decoder = table.new_stream_decoder();
decoder.received(frame_bytes);
decoder.decode().is_ok()
match decoder.decode() {
Ok(frame) => frame.display_message().to_string().len() > frame_bytes.len(),
Err(_) => false,
}
};

let assume_text = |frame_bytes: &[u8]| {
Expand Down

0 comments on commit 865f4a4

Please sign in to comment.