Yesterday my exams session finally ended, I’m really satisfied about the results achieved, but during the studying period I was eager to get back to coding…
Today I fixed bug #0000008, a fastidious one which caused program termination if the user tried to take a screenshot after having deleted the hidden directory inside his home where settings and images are saved by default. 🙂

The first thing I thought was that I was missing a fopen() return code check, but, fortunately for my reputation, it wasn’t the case. 😉
// Opening output file
if((fp = fopen(filename, "wb")) == NULL)
{
throw Exception("Screen", "fopen error");
return -1;
}
The problem, as the shell output was suggesting, was related to the exception system: the fopen() exception was never caught.
Just changing this:
case SDLK_F4: screen->TakeScreenshot(); break;
into this:
case SDLK_F4:
try
{
screen->TakeScreenshot();
}
catch(Exception e)
{
e.PrintError();
}
break;
fixed everything.
Have a look at r622 log and at mars.cpp changes and remember to catch all the exception you may throw. 😉