fzy

terminal fuzzy finder picker

git clone https://9o.is/git/fzy.git

commit f4739fab12a46c19081b24b7c1091215a133bc09
parent 5cb085ee06494dd9b65b5b51e5676b4267806886
Author: John Hawthorn <john@hawthorn.email>
Date:   Fri,  6 Dec 2024 22:16:45 -0800

Initialize avoid uninitialized variable warning

These pointers were never dereferenced in their uninitialized form, as
that only happens for i > 0, but we should do this to avoid the compiler
warning.

Diffstat:
Msrc/match.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/match.c b/src/match.c @@ -187,7 +187,7 @@ score_t match_positions(const char *needle, const char *haystack, size_t *positi M = malloc(sizeof(score_t) * MATCH_MAX_LEN * n); D = malloc(sizeof(score_t) * MATCH_MAX_LEN * n); - score_t *last_D, *last_M; + score_t *last_D = NULL, *last_M = NULL; score_t *curr_D, *curr_M; for (int i = 0; i < n; i++) {