ASAN error in guess

pic
When I finish the whole program, I try to run it in vs-code, my guess works fine and I don’t think there are any bugs. What i used is fgetc() , and I’m emptying the buffer every time before asking the user to enter a new word. In the picture I tried many cases and the program works fine. But I still can’t pass the guess test, except guess-wrong. Is there any suggestions, that may help me solve this problem?