diff options
Diffstat (limited to '')
-rw-r--r--source/ui-refs.c6
-rw-r--r--source/ui-shared.c2
2 files changed, 3 insertions, 5 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++)
diff --git a/source/ui-shared.c b/source/ui-shared.c
index 409ad40..7d28c39 100644
--- a/source/ui-shared.c
+++ b/source/ui-shared.c
@@ -485,7 +485,7 @@ static int print_branch_option(const struct reference *ref, void *data)
const char *name = ref->name;
// The switcher runs on every page, so it is bounded like the refs list.
- if (ctx.cfg.max_ref_count && opt->count >= ctx.cfg.max_ref_count)
+ if (ctx.cfg.max_ref_count > 0 && opt->count >= ctx.cfg.max_ref_count)
return -1;
// A name spelled like an option is refused as a head, so offering it
// would only lead to an error page.