Skip to content

Commit

Permalink
fix: overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
my0sotis committed Oct 26, 2023
1 parent abf5ba7 commit df69307
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion deps/common/lang/comparator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ int compare_int(void *arg1, void *arg2)
{
int v1 = *(int *)arg1;
int v2 = *(int *)arg2;
return v1 - v2;
if (v1 > v2) {
return 1;
} else if (v1 < v2) {
return -1;
} else {
return 0;
}
}

int compare_float(void *arg1, void *arg2)
Expand Down

0 comments on commit df69307

Please sign in to comment.