diff options
Diffstat (limited to 'source/ui-refs.c')
| -rw-r--r-- | source/ui-refs.c | 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 2 insertions, 4 deletions
diff --git a/source/ui-refs.c b/source/ui-refs.c index e4a0dd0..890a959 100644 --- a/source/ui-refs.c +++ b/source/ui-refs.c @@ -294,7 +294,7 @@ void cgit_print_branches(int maxcount) print_branch_header(); collect_branches(&list); - if (maxcount == 0 || maxcount > list.count) + if (maxcount <= 0 || maxcount > list.count) maxcount = list.count; // The date sort covers the list, the name sort only the rows about to @@ -323,9 +323,7 @@ void cgit_print_tags(int maxcount) if (list.count == 0) return; qsort(list.refs, list.count, sizeof(*list.refs), cmp_date); - if (!maxcount) - maxcount = list.count; - else if (maxcount > list.count) + if (maxcount <= 0 || maxcount > list.count) maxcount = list.count; print_tag_header(); for (i = 0; i < maxcount; i++) |
