sequence: Fix yet another case of improper sequence comparison.
This time, in mp_seq_cmp_bytes(). How many more cases are still lurking?
This commit is contained in:
parent
767e45c290
commit
ad3baec12f
@ -100,6 +100,10 @@ bool mp_seq_cmp_bytes(int op, const byte *data1, uint len1, const byte *data2, u
|
|||||||
}
|
}
|
||||||
uint min_len = len1 < len2 ? len1 : len2;
|
uint min_len = len1 < len2 ? len1 : len2;
|
||||||
int res = memcmp(data1, data2, min_len);
|
int res = memcmp(data1, data2, min_len);
|
||||||
|
if (op == MP_BINARY_OP_EQUAL) {
|
||||||
|
// If we are checking for equality, here're the answer
|
||||||
|
return res == 0;
|
||||||
|
}
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -49,3 +49,5 @@ print(b"1" <= b"10")
|
|||||||
print(b"1" <= b"1/")
|
print(b"1" <= b"1/")
|
||||||
print(b"10" <= b"1")
|
print(b"10" <= b"1")
|
||||||
print(b"1/" <= b"1")
|
print(b"1/" <= b"1")
|
||||||
|
|
||||||
|
print(b'o' == b'\n')
|
||||||
|
Loading…
Reference in New Issue
Block a user