diff --git a/server.c b/server.c index da982265a18627db16cc72e4a34ce0fae6615147..202b8cf9c760a493880363dca674d5fbe7a81b27 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");