diff --git a/server.c b/server.c index 102bddcfcbfec2477e1ff91dac9865eeae5aea05..2a7dd185cbaacfeb35aa58b803ad7839be4cfb48 100644 --- a/server.c +++ b/server.c @@ -335,7 +335,7 @@ bool show_modified_page(int sockfd, const char* htmldir, char* added, int n; // the length needs to include the html tags for the username - int added_length = strlen(added); + int added_length = strlen(added) + 1; // get the size of the file struct stat st; @@ -385,7 +385,7 @@ bool show_start_page(int sockfd, char* username) { // the length needs to include the html tags for the username int added_length = username_length + 9; - char added[added_length + 1]; + char added[added_length]; // create added string strcat(added, added_prefix);