diff --git a/inc/match.h b/inc/match.h index 9874b36..508c746 100644 --- a/inc/match.h +++ b/inc/match.h @@ -34,7 +34,7 @@ enum matching_mode { }; int sort_for_matching_mode(const char *text1, const char *text2, int fallback, - enum matching_mode match_type, const char *filter, bool insensitive); + enum matching_mode match_type, const char *filter, bool insensitive); bool match_for_matching_mode(const char* filter, const char* text, enum matching_mode matching, bool insensitive); #endif diff --git a/src/match.c b/src/match.c index 25a1604..3f51973 100644 --- a/src/match.c +++ b/src/match.c @@ -81,7 +81,7 @@ static bool fuzzy_match(const char* filter, const char* text, bool insensitive) } // we just check that all the characters (ignoring case) are in the // search text possibly case insensitively in the correct order - while(*filter) { + while(*filter != 0) { char nch = *filter++; if(!(text = strcasechr(text, nch, insensitive))) { @@ -229,7 +229,7 @@ static inline void match_row(int row, score_t* curr_D, score_t* curr_M, // which has been implemented here. static score_t fuzzy_score(const char* haystack, const char* needle, bool insensitive) { - if(!*needle) + if(*needle == 0) return SCORE_MIN; int n = strlen(needle);