From c171c10bf61efa5ff1a441a0256f974cbb661f83 Mon Sep 17 00:00:00 2001 From: ChouTatsumi <choutatsumi@gmail.com> Date: Mon, 29 Apr 2019 21:33:57 +1000 Subject: [PATCH] bug 21:33 --- server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.c b/server.c index da98226..202b8cf 100644 --- a/server.c +++ b/server.c @@ -339,7 +339,7 @@ bool show_modified_page(int sockfd, const char* htmldir, char* added, // get the size of the file struct stat st; - stat(START_PAGE, &st); + stat(htmldir, &st); // increase file size to accommodate the username long size = st.st_size + added_length; n = sprintf(buff, HTTP_200_FORMAT, size); @@ -349,7 +349,7 @@ bool show_modified_page(int sockfd, const char* htmldir, char* added, return false; } // read the content of the HTML file - int filefd = open(START_PAGE, O_RDONLY); + int filefd = open(htmldir, O_RDONLY); n = read(filefd, buff, 2048); if (n < 0) { perror("read"); -- GitLab