Guard against division by zero

This commit is contained in:
Krister Jansson 2018-11-23 00:58:18 +01:00
parent a974b6ed8a
commit abfc0ad8a2
1 changed files with 7 additions and 1 deletions

View File

@ -15,7 +15,6 @@
#include <sys/syslimits.h>
#include <unistd.h>
// TODO: Align devision by zero protection
// TODO: Readme.md
// TODO: Readme for Amiga
// TODO: Pack
@ -24,6 +23,7 @@
// TODO: Scripted tests!
// BUG: Can't rename single file
// BUG: Can't rename single file from it's file.info file
// BUG: Problems reading some icons width/heigth information
// C helpers
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
@ -163,6 +163,12 @@ int main(int argc, char **argv)
// return RETURN_ERROR;
// }
if (AlignX == 0 || AlignY == 0)
{
Information("Can't align to 0\n");
return RETURN_ERROR;
}
unsigned int fixCount = 0;
if (!fileOption && !dirOption)
{