diff options
| -rw-r--r-- | source/ui-stats.c | 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 7 insertions, 1 deletion
diff --git a/source/ui-stats.c b/source/ui-stats.c index 4c83cf3..d0fcfd8 100644 --- a/source/ui-stats.c +++ b/source/ui-stats.c @@ -213,7 +213,13 @@ static int cmp_total_commits(const void *a1, const void *a2) const struct authorstat *auth1 = i1->util; const struct authorstat *auth2 = i2->util; - return auth2->total - auth1->total; + // Return the sign only, since a long difference truncated to int could + // flip and leave the comparator inconsistent. + if (auth2->total > auth1->total) + return 1; + if (auth2->total < auth1->total) + return -1; + return 0; } /* Walk the commit DAG once for the configured window. One walk, no |
