diff --git a/server.c b/server.c
index 9f1302f564c7e9b9129ba63936afd3d69b3e93a2..48e618ef234a4a5c4cb8f7569005bd1eaa7f0f75 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 = sizeof(added);
 
     // get the size of the file
     struct stat st;