fix bug of kmp search

fix bug of kmp search