Skip to main content
9 events
when toggle format what by license comment
May 23, 2017 at 12:37 history edited CommunityBot
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Oct 14, 2016 at 12:39 vote accept JaviMar
Oct 14, 2016 at 12:39 comment added JaviMar I had it to eliminate /dir/ instances since I thought it was causing access() to return -1. I was wrong big time. Now fixed! Thanks!!
Oct 14, 2016 at 12:17 comment added DinoCoderSaurus What is this all about? if (path[0] == '/') { path++; }
Oct 14, 2016 at 12:11 comment added JaviMar thanks again. Things seem to get better even though the erros remain. This is the output of check50: :( Requesting /test/ outputs /test/index.html :( Requesting directory containing index.php outputs index.php \ expected output, but not "HTTP/1.1 200 OK\r\nContent-Type: text/h..."
Oct 14, 2016 at 11:08 history edited DinoCoderSaurus CC BY-SA 3.0
clarification
Oct 14, 2016 at 11:07 comment added DinoCoderSaurus Do not use sizeof. Full stop. sizeof(int) is 4. You are allocating dir for 4 bytes. Not big enough.strlen(path) + strlen(html) + 1 is how many bytes you want dir to be. Here is a good explanation.
Oct 14, 2016 at 10:05 comment added JaviMar Thanks. I have deleted the '\0' lines, and only malloc the larger html string (dir = malloc(sizeof(strlen(path) + strlen(html) + 1)), also deleted the free part, but as you said, that was not the problem, so we back to the original question of those two errors. Please help!
Oct 13, 2016 at 23:06 history answered DinoCoderSaurus CC BY-SA 3.0