Skip to content

Commit b2389a6

Browse files
committed
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.
1 parent 9aa19d3 commit b2389a6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/match.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ score_t match_positions(const char *needle, const char *haystack, size_t *positi
187187
M = malloc(sizeof(score_t) * MATCH_MAX_LEN * n);
188188
D = malloc(sizeof(score_t) * MATCH_MAX_LEN * n);
189189

190-
score_t *last_D, *last_M;
190+
score_t *last_D = NULL, *last_M = NULL;
191191
score_t *curr_D, *curr_M;
192192

193193
for (int i = 0; i < n; i++) {

0 commit comments

Comments
 (0)