I am currently working on the server pset however my server doesn't load the files even if the status printed in the terminal is 200. Also if I refresh the page it will be changed to 404. Can someone help me please?
I have many takes on your code which you posted here, but I'm gonna answer your question specifically. what's causing this weird behavior is that you're using
strcat's man page:
char *strcat(char *dest, const char *src);
strcat()function appends the
srcstring to the
deststring, over‐writing the terminating null byte (
'\0') at the end of
dest, and then adds a terminating null byte.
so you're changing the value of
root which causes things to crash.