aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-10-04 22:26:00 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-10-04 22:26:00 +0200
commit5743ce6820c0cfceab4cc71229b5b069b99a8dce (patch)
tree87341b5a5bdcc53dc220aa01f5f0b32434a0ec30
parent9f298a2098fa244ac763bc4d22ccf3fb7c9760bb (diff)
Check for ā€˜-pā€™ never being passed
-rw-r--r--main.l3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.l b/main.l
index 9478c16..cae65e7 100644
--- a/main.l
+++ b/main.l
@@ -156,6 +156,9 @@ atou(const char *s)
bool
print_ordinal(void)
{
+ if (positions.ps == NULL)
+ return true;
+
/* Basic binary search */
for (size_t l = 0, r = positions.len - 1, m; l <= r;) {
m = l + (r - l) / 2;