summaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2014-08-03 23:55:33 -0700
committerJohn Hawthorn <john.hawthorn@gmail.com>2014-08-04 01:05:37 -0700
commit47317b330fb56374398e9ace36f7cebee2a39f90 (patch)
treeb0d22b62eed6cb00ab8723dadf1993d3bb5864ea /match.c
parent0a24d45349af1f30abec2f716e65ccb411a4439c (diff)
Only M[0][0] should default to 0
Diffstat (limited to 'match.c')
-rw-r--r--match.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/match.c b/match.c
index 6d340d1..ac35711 100644
--- a/match.c
+++ b/match.c
@@ -103,7 +103,7 @@ double calculate_score(const char *needle, const char *haystack, size_t *positio
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
- score_t score = j ? SCORE_MIN : 0;
+ score_t score = (j || i) ? SCORE_MIN : 0;
int match = tolower(needle[i]) == tolower(haystack[j]);
D[i][j] = SCORE_MIN;
if(match){