ImHex-Patterns icon indicating copy to clipboard operation
ImHex-Patterns copied to clipboard

Adding checks to ends_with and starts_with to prevent failure

Open MartorSkull opened this issue 1 year ago • 0 comments

Fixing cases where part is longer than string, this cases should both return false instead of failing.

E.g.:

ends_with("asdf", "0123456789");

fails with

E: runtime error: Character index 4294967290 out of range of string 'asdf' with length 4.

but it should simply return false.

This should be merged together with a fix to the builtin substr function to throw an error if the desired substring does not fit inside the string.

MartorSkull avatar Aug 21 '24 18:08 MartorSkull