Skip to content

Commit

Permalink
Initialize avoid uninitialized variable warning
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jhawthorn committed Dec 7, 2024
1 parent 9aa19d3 commit b2389a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/match.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit b2389a6

Please sign in to comment.