This should never happen if this is called properly (match only returns
valid results if there IS a match), but it's nice to double check here.
| ... | ... |
@@ -76,7 +76,7 @@ score_t match_positions(const char *needle, const char *haystack, size_t *positi |
| 76 | 76 |
int n = strlen(needle); |
| 77 | 77 |
int m = strlen(haystack); |
| 78 | 78 |
|
| 79 |
- if (m > MATCH_MAX_LEN || n > MATCH_MAX_LEN) {
|
|
| 79 |
+ if (m > MATCH_MAX_LEN || n > m) {
|
|
| 80 | 80 |
/* |
| 81 | 81 |
* Unreasonably large candidate: return no score |
| 82 | 82 |
* If it is a valid match it will still be returned, it will |