diff --git a/server.c b/server.c index 48e618ef234a4a5c4cb8f7569005bd1eaa7f0f75..3dfbf83eb281cfb7cab85d15f865638eebab38a8 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 = sizeof(added); + int added_length = strlen(added); // get the size of the file struct stat st; @@ -357,6 +357,9 @@ bool show_modified_page(int sockfd, const char* htmldir, char* added, return false; } close(filefd); + + print_buff(buff); + // move the trailing part backward int p1, p2; for (p1 = size - 1, p2 = p1 - added_length; p1 >= size - inset_index;