Menu

#24 strncmp can return something else than -1/0/1

Git HEAD
closed
None
5
2015-02-01
2015-01-28
No

testRangeComparison() in test/test.cpp assumes that strncmp() used by uriCompareRangeA() will always return -1/0/1 values.

So it fails on AArch64:

UriSuite: 50/52
Comparing to yields -64, expected -1.
Comparing to
yields 64, expected 1.
UriSuite: 51/52

Why? Simple. C standard says that strncmp() has to return <0/0/>0 values.

Attached fix alters uriCreateRangeA() function to return -1/0/1 values so tests pass.

1 Attachments

Discussion

  • Sebastian Pipping

    Thanks for the report and the patch. It is applied in Git now. Closing.

     
  • Sebastian Pipping

    • status: open --> closed
    • assigned_to: Sebastian Pipping
     

Log in to post a comment.