CompareNoCase incorrectly compares strings #3

Closed
opened 2 years ago by tomasz.sowa · 0 comments
Owner

CompareNoCase incorrectly returns that string1 is greater than string2 for some special characters, sample:

	char foo[] = {"abc"};
	char bar[] = {"abc"};

	foo[0] = (char)(unsigned char)127;
	bar[0] = (char)(unsigned char)128;

	std::cout << PT::CompareNoCase((const char*)foo, (const char*)bar) << std::endl;

 	printed value is 255 but should be -1
CompareNoCase incorrectly returns that string1 is greater than string2 for some special characters, sample: ``` char foo[] = {"abc"}; char bar[] = {"abc"}; foo[0] = (char)(unsigned char)127; bar[0] = (char)(unsigned char)128; std::cout << PT::CompareNoCase((const char*)foo, (const char*)bar) << std::endl; printed value is 255 but should be -1 ```
tomasz.sowa added the bug label 2 years ago
tomasz.sowa self-assigned this 2 years ago
tomasz.sowa closed this issue 2 years ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: tomasz.sowa/pikotools#3
Loading…
There is no content yet.