KMP C code change