My program compiles correctly, but when I use check50
, I get multiple errors. I believe there is a segmentation fault in indexes
because all of the check50
tests return 0.
Does the segmentation fault result from my use of malloc()
in my code?
Thanks in advance!
Here is my code:
// edited out per academic honesty
Here is check50:
:) server.c exists
:) server compiles
:( Requesting cat.jpg returns 200, image/jpeg, and correct image
:( Requesting cat.html returns 200, text/html, and correct file
:( Requesting cat2.HTML returns 200, text/html, and correct file
:( Requesting cat3.HtMl returns 200, text/html, and correct file
:( Requesting cat.gif returns 200, image/gif, and correct file
:( Requesting favicon.ico returns 200, image/x-icon, and correct file
:( Requesting test.css returns 200, text/css, and correct file
:( Requesting test.js returns 200, text/javascript, and correct file
:( Requesting hello.php returns 200, text/html, and correct output
\ expected output, not an exit code of 0
:( Requesting hello.php? returns 200, text/html, and correct output
\ expected output, not an exit code of 0
:( Requesting hello.php?name=Alice returns 200, text/html, and correct output
\ expected output, not an exit code of 0
:) Requesting /test redirects to /test/
:( Requesting /test/ outputs /test/index.html
:( Requesting directory containing index.php outputs index.php
\ expected output, not an exit code of 0
:( Requesting two files in a row (cat.html then cat.jpg) succeeds
joined_string
andjoined_string2
are not allocated, which will cause a memory leak, but a request tocat.jpg
et al will not call indexes, so it's not the whole problem. The seg fault on all php calls may indicate an additional problem in load, ie using some "file-positioning" call (likefseek
), which can't be used with pipes. info here.strcat(string1, index_php);
, this sequencefree(string1); return joined_string;
will return "nothing". Ditto joined_string2.free(string1); return joined_string;
does nothing, right? If I don't need to allocate memory, should I re-arrange my sequences?