I am very close to getting my dictionary to word correctly, but I am having a small hiccup in my check function. In order to compare the word given in the check function to the dictionary, I first want to copy the given word in lowercase (because the dictionary entries are all lowercase). As I do this, I am running into a strange problem where I copy 3 letters successfully, but on the fourth letter my new_word char* gets the characters "rgy" appended. Here is the code I am dealing with.
char* new_word = malloc((LENGTH+1) * sizeof(char)); int length = strlen(word); for (int i = 0; i < length; i++) new_word[i] = tolower(word[i]);
Also, here is a link to a picture of my gdb as I run through this code on the word "AUSTIN" as an example of what is happening. http://ibin.co/2A6FgqqDTh9O