diff options
| author | WormHeamer | 2026-01-02 06:01:31 -0500 |
|---|---|---|
| committer | WormHeamer | 2026-01-02 06:01:31 -0500 |
| commit | bec1fd2771449a532366afa07e4754ffdc350d5b (patch) | |
| tree | 1ea5ad86fa3da135d508e140b8bc4de74b1a7de4 | |
| parent | d83cc235924cacceeea86c890a404f497a0a74de (diff) | |
check for non-null chunk in txt_range_equal()
| -rw-r--r-- | txt.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -387,9 +387,8 @@ int txt_range_equal(TxtLoc lo, TxtLoc hi, Str cmp) { Str s = txt_next_chunk(&lo); u32 n = cmp.n - i; if (s.n < n) n = s.n; - if (memcmp(s.s, cmp.s + i, n)) { + if (s.n > 0 && memcmp(s.s, cmp.s + i, n)) return 0; - } i += s.n; } return 1; |
