Hello folks,

I think there is a bug in the API function StrNCompare in PalmOS5. When I use the function with a very long string to compare (several KB long), it fails. That means it does not return 0 where it should.

The strange thing is that I give a very small n value to compare, something like n=6, because the token to compare to is 6 Bytes long. So the function only has to process the first 6 Bytes at most, and it should not matter whether the string is ten or ten thousand bytes long. Also, the function does not need any memory allocation that could fail.

Yes, the strings are all null-terminated. My routine that needs the StrNCompare works perfectly in most of the cases. We have written our own implementation of StrNCompare and it works fine. But our own function is not ARM-optimised, and we prefer native API calls. I have not made any checks yet to determine the size limitation when it starts to fail.

Could somebody please verify this?

Kind regards,
Alexander Lange.


-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to