Better COFF String Detection and Big Endian Wide Strings by HaydnTrigg · Pull Request #321 · encounter/objdiff
Conversation
Comment on lines +193 to +196
| // Inline loop to strip all trailing "\0" | ||
| while let Some(stripped) = string.strip_suffix('\0') { | ||
| string = stripped.to_string(); | ||
| } |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would something like
| // Inline loop to strip all trailing "\0" | |
| while let Some(stripped) = string.strip_suffix('\0') { | |
| string = stripped.to_string(); | |
| } | |
| string = string.trim_end_matches('\0'); |
still work here? Might be able to remove the while loop if it does.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me give it a go ¯_(ツ)_/¯ My ability to code Rust is comparable to a child learning to walk at the moment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

