CompareNoCase incorrectly compares strings #3

Closed
opened 2021-05-08 19:49:00 +02:00 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 2021-05-08 19:49:00 +02:00
tomasz.sowa self-assigned this 2021-05-08 19:49:00 +02:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tomasz.sowa/pikotools#3
No description provided.