-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] std::string::replace
truncates output, proportional to length of pattern
#1279
Comments
Thank you for reporting this bug. I submitted a pr in the imhex-patterns repo for this bug here you can either check the change there and add it or wait until it gets merged (if it gets merged that is) and added to this repo. |
It looks like the fix in WerWolv/ImHex-Patterns#157 was buggy. The test case now prints:
|
thats very weird. I am sure it was right. Let me see and mahe sure I get it right this time |
I found out what was wrong and how to fix it, somehow a +1 was turned into a -1. Please also note that you don't need to wait until the changes I commit get merged to test them. The Pull Request contains all the code needed to be able to test the changes. You are welcome to post to the Pull Request at any time and not only when it gets merged. If you don't feel comfortable posting there you may also post here if the changes proposed don't fix the issue. I: azcdefg
I: azdefg
I: azefg
I: abcdefg
I: abcdefg
I: abcdefg
I: Pattern exited with code: 0
I: Evaluation took 0.0817567s I apologize for any problems this issue may have caused. Thank you for taking the time to test and post the results of the tests. |
Fixed in WerWolv/ImHex-Patterns#163. |
Operating System
Linux
What's the issue you encountered?
std::string::replace()
removeslen(pattern) - 1
characters from the end of its return value, regardless of whether the input string contains the pattern.How can the issue be reproduced?
This pattern code:
produces:
ImHex Version
1.30.1
ImHex Build Type
Installation type
Fedora (imhex-1.30.1-3.fc38.x86_64)
Additional context?
No response
The text was updated successfully, but these errors were encountered: