Open GoogleCodeExporter opened 9 years ago
Email from Gil Ross on 2013/01/16:
If HAVE_STRING_H is true, and strncmp is implemented as follows:
int strncmp(const char *s1, const char *s2, size_t n)
{ /* compare unsigned char s1[max n], s2[max n] */
for (; 0 < n; ++s1, ++s2, --n)
if (*s1 != *s2)
return ( *(unsigned char *)s1
< *(unsigned char *)s2 ? -1 : +1);
else if (*s1 == '\0')
return (0);
return (0);
}
The code below should assert:
seq1 = bytearray( [0xAA, 0xAA, 0xAA, 0xAA, 0x00, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA] )
seq2 = bytearray( [0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA] )
assert seq1 == seq2
Original comment by dwhall...@gmail.com
on 14 Feb 2013 at 1:41
Original issue reported on code.google.com by
dwhall...@gmail.com
on 14 Feb 2013 at 1:41