Skip to content

Commit

Permalink
[pick #18710][Disassembler] Fix string contraction logic
Browse files Browse the repository at this point in the history
## Description

Always pick whole UTF8 characters.

## Test plan

Tested against a package containing a UTF8 constant.
  • Loading branch information
amnn committed Jul 17, 2024
1 parent 0e22aed commit 7ff72ae
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ impl<'a> Disassembler<'a> {
if s.len() <= PREVIEW_LEN + 2 {
s.to_string()
} else {
format!("{}..", &s[..PREVIEW_LEN])
let mut preview: String = s.chars().take(PREVIEW_LEN).collect();
preview.push_str("..");
preview
}
}

Expand Down

0 comments on commit 7ff72ae

Please sign in to comment.