diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Sort an empty list without handing qsort a null
Every list sorted here is null until its first entry, and C leaves a
null base undefined even with nothing to sort. glibc declares it nonnull
and its UBSan build aborted the stats page of a repository with no
commits in the window, which the Linux matrix caught.
Diffstat (limited to '')
| -rw-r--r-- | source/ui-repolist.c | 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 1 insertion, 1 deletion
diff --git a/source/ui-repolist.c b/source/ui-repolist.c index 58e31ed..6df70e4 100644 --- a/source/ui-repolist.c +++ b/source/ui-repolist.c @@ -402,7 +402,7 @@ static int sort_repolist(const char *field) continue; if (column->cmp == cmp_idle || column->cmp == cmp_section) resolve_modtimes(); - qsort(cgit_repolist.repos, cgit_repolist.count, sizeof(struct cgit_repo), column->cmp); + cgit_qsort(cgit_repolist.repos, cgit_repolist.count, sizeof(struct cgit_repo), column->cmp); return 1; } return 0; |
