Closed curiouskiwi closed 6 years ago
Example: Declare a char array: char cipher[strlen(p)]; and then later, try to set cipher[strlen(p)] = '\0' which is one past the end of the array. error: vigenere.c:56:17: runtime error: index 2 out of bounds for type 'char [strlen(p)]'
char cipher[strlen(p)];
cipher[strlen(p)] = '\0'
vigenere.c:56:17: runtime error: index 2 out of bounds for type 'char [strlen(p)]'
Actually, this is already handled by the server.
https://github.com/cs50/help50-server/blob/master/helpers/clang.py#L28 https://github.com/cs50/help50-server/blob/master/helpers/clang.py#L548
Example: Declare a char array:
char cipher[strlen(p)];
and then later, try to setcipher[strlen(p)] = '\0'
which is one past the end of the array. error:vigenere.c:56:17: runtime error: index 2 out of bounds for type 'char [strlen(p)]'