* turn `integer overflow` debug message into an assert

* dump less information in the debug log if the assert is triggered (just "integer overflow; no more filenumbers available.")

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1481 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2007-04-16 20:00:12 +00:00
parent 7527047316
commit dcf4cb3263
1 changed files with 5 additions and 6 deletions

View File

@ -678,10 +678,9 @@ void screenDumpToDisk(const char* path) {
}
}
if (screendump_num == 0)
{
debug( LOG_ERROR, "screenDumpToDisk: no more file numbers available, we possibly have just had an integer overflow. That means the user has at least %u screenshots stored\n", (unsigned int)pow(2, CHAR_BIT * sizeof(unsigned int)) - 1);
return;
}
screendump_required = TRUE;
ASSERT( screendump_num != 0, "screenDumpToDisk: integer overflow; no more filenumbers available.\n", );
// If we have an integer overflow, we don't want to go about and overwrite files
if (screendump_num != 0)
screendump_required = TRUE;
}