Skip to content
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

[ArrayFindString] String search does not work correctly #779

Open
ArKaNeMaN opened this issue Oct 27, 2019 · 3 comments
Open

[ArrayFindString] String search does not work correctly #779

ArKaNeMaN opened this issue Oct 27, 2019 · 3 comments

Comments

@ArKaNeMaN
Copy link
Contributor

if (fastcellcmp(a, b, len))

The ArrayFindString function finds a string whose beginning matches the required string, But it must search for an equal string

@ArKaNeMaN ArKaNeMaN changed the title String search does not work correctly [ArrayFindString] String search does not work correctly Oct 27, 2019
@WPMGPRoSToTeMa
Copy link
Contributor

WPMGPRoSToTeMa commented Oct 27, 2019

I hope it can be fixed by replacing:

size_t a_len = ke::Max(1, amxstring_len(a));

With:

 size_t a_len = amxstring_len(a) + 1;

So, the length will always include zero terminator which would fix the comparison.

Can you verify this fix and create a pull request if it works correctly?

@RauliTop
Copy link

RauliTop commented Nov 8, 2019

@ArKaNeMaN had you test it?

Explain the results please, to consider a future pull request.

@dystopm
Copy link

dystopm commented Mar 28, 2020

I'm looking for a fix to this, it is matching with just the beggining, will maybe an extra parameter be enough?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants