Seb,
Yes, I can reproduce this issue.
{ 1, 0 }
{ 1, 1 }
returns 0, when it should return -1.
Interestingly, if you use:
{ 1, 1, 1, 1, 0 } //i.e. 5 bytes
{ 1, 1, 1, 1, 1 } //i.e. 5 bytes
as the strings, it returns -1. So it clearly has a problem if the
string is exceptionally short. That got me thinking. How short?
{ 1, 1, 1, 0 } //i.e. 4 bytes, returns -1
{ 1, 1, 1, 1 }
{ 1, 1, 0 } //i.e. 3 bytes, returns -1
{ 1, 1, 1 }
{ 1, 0 } //i.e. 2 bytes, return -1
{ 1, 1 }
{ 0 } //i.e. 1 byte, returns -1 : HOLD ON, WHAT?
{ 1 }
----
So the 1-bye case succeeded, but why? The only difference between that
and the failing case was two null bytes which shouldn't even be examined.
----
{ 0, 0 } //i.e. original test case. Fails, returns 0
{ 1, 0 }
{ 1, 0, 0 } //fails, returns 0.
{ 1, 1, 0 }
{ 1, 1, 0, 0 } //fails, returns 0.
{ 1, 1, 1, 0 }
{ 1, 1, 1, 0, 0 } //fails, returns 0.
{ 1, 1, 1, 1, 0 }
{ 1, 1, 1, 1, 0, 0 } //fails, returns 0.
{ 1, 1, 1, 1, 1, 0 }