mirror of
https://github.com/nfc-tools/mfoc.git
synced 2026-01-11 23:43:21 +00:00
Fix compar_int
'uint64_t' - 'uint64_t' may overflow return type int. cf https://stackoverflow.com/questions/36681906/c-qsort-doesnt-seem-to-work-with-unsigned-long Thanks @xianglin1998 !
This commit is contained in:
parent
ba072f16f6
commit
a5a4c9184d
@ -1198,7 +1198,9 @@ uint32_t median(denonce d)
|
||||
|
||||
int compar_int(const void *a, const void *b)
|
||||
{
|
||||
return (*(uint64_t *)b - * (uint64_t *)a);
|
||||
if (*(uint64_t *)b == *(uint64_t *)a) return 0;
|
||||
if (*(uint64_t *)b < * (uint64_t *)a) return 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Compare countKeys structure
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user