From 7df359af41d36be95a00fd7a2c3b9ed1e54f27cb Mon Sep 17 00:00:00 2001 From: ChouTatsumi <choutatsumi@gmail.com> Date: Mon, 29 Apr 2019 21:15:05 +1000 Subject: [PATCH] test 21:15 --- server.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server.c b/server.c index 48e618e..3dfbf83 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; -- GitLab