From f6a94ebb2ddecb90933b4012539b7596e5c1fe01 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 4 Oct 2023 22:26:15 +0200 Subject: Use ssize_t to avoid underflow --- main.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3