aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-10-04 22:26:15 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-10-04 22:26:15 +0200
commitf6a94ebb2ddecb90933b4012539b7596e5c1fe01 (patch)
treed255634e11bbca420cd7699419eb765813ac1f74
parent5743ce6820c0cfceab4cc71229b5b069b99a8dce (diff)
Use ssize_t to avoid underflow
-rw-r--r--main.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.l b/main.l
index cae65e7..144fef3 100644
--- a/main.l
+++ b/main.l
@@ -160,7 +160,7 @@ print_ordinal(void)
return true;
/* Basic binary search */
- for (size_t l = 0, r = positions.len - 1, m; l <= r;) {
+ for (ssize_t l = 0, r = positions.len - 1, m; l <= r;) {
m = l + (r - l) / 2;
if (positions.ps[m] == pos)
return true;