mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02:00
translate: Fix translate_key_compare().
Sizes of translate keys must also match.
This commit is contained in:
parent
f7d1689cfa
commit
7124fa16ef
1 changed files with 7 additions and 2 deletions
|
|
@ -103,8 +103,13 @@ static INLINE int translate_keysize( const struct translate_key *key )
|
|||
static INLINE int translate_key_compare( const struct translate_key *a,
|
||||
const struct translate_key *b )
|
||||
{
|
||||
int keysize = translate_keysize(a);
|
||||
return memcmp(a, b, keysize);
|
||||
int keysize_a = translate_keysize(a);
|
||||
int keysize_b = translate_keysize(b);
|
||||
|
||||
if (keysize_a != keysize_b) {
|
||||
return keysize_a - keysize_b;
|
||||
}
|
||||
return memcmp(a, b, keysize_a);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue