mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
pattern/bencode: Various fixes (#393)
* Fix bencode dictionary When parsing a bencode dictionary, the end character 'e' was never consumed. This caused a misinterpretation of the character as struct Value of an unknown type 'e'. * Fix bencode list A list was not included in the Value's parsing logic so it may have been mistakenly parsed as a string. * Fix std::ctype::isprint not including space The space character, 0x20, is considered as a printable character in ASCII and in >=C89. Adding it to the range of std::ctype::isprint also fixes other std::ctype functions that use it. * Fix bencode byte string formatting Byte strings do not render nicely in pattern data's value column if they contain non-printable characters. This commit makes the value of byte strings to be surrounded by quotation marks, and renders a warning text without quotation marks if the byte string contains non-printable characters.
This commit is contained in:
@@ -85,7 +85,7 @@ namespace auto std::ctype {
|
||||
@return True if `c` is part of this range, false otherwise
|
||||
*/
|
||||
fn isprint(char c) {
|
||||
return c >= '0' && c <= '~';
|
||||
return c >= ' ' && c <= '~';
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user