I have run GDB on this section of code using http://localhost:8080/test/ To mimic the check50 test to see why my code is failing that test. When I did this, I got the following when info locals was run:
try1 = 0x7fffffff9c00 "/home/ubuntu/workspace/pset6/public/test/index.php" try2 = 0x7fffffff9bc0 "/home/ubuntu/workspace/pset6/public/test/index.html"
This seems all fine to me as strcat was causing issues so I made 2 test cases. When I then get to the conditions in my code, the code runs down the first branch of the condition (it chooses that index.php exists in /test/ folder which it quite obviously does not.
I have attached the link to my indexes function below:
https://gist.github.com/anonymous/d8e90334032d3a4deffa9db36d4deead
Any idea why this would happen? It seems like this should be no problem at all and yet it is causing me a lot of issues. I have gotten thru getting the right output and I am returning a pointer as expected, this seems like a very weird issue to have with a correct address. Any help is appreciated.