[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MiNT] [PATCH] TosWin2 startup crash
Hello.
Eero noticed that TosWin2 crashes very early due to a Bus Error at address
0. This happens with the standard ARAnyM, but not the JIT version.
Also, it does not crash on the FireBee because unlike Atari machines, the
memory below 0x800 is readable in user mode.
The attached patch fixes this problem. Please commit.
toswin2.patch
Fix crash at startup on standard Atari machines. Contributed by Vincent Riviere.
--
Vincent Riviere
diff -x CVS -aurN freemint.orig/tools/toswin2/main.c freemint/tools/toswin2/main.c
--- freemint.orig/tools/toswin2/main.c 2008-08-20 00:20:24.000000000 +0200
+++ freemint/tools/toswin2/main.c 2013-01-09 21:37:51.750000000 +0100
@@ -43,7 +43,7 @@
char str[25];
OBJECT *tmp;
- if (getenv("DEBUG") || strcmp(argv[1], "--debug") == 0)
+ if (getenv("DEBUG") || (argc >=2 && strcmp(argv[1], "--debug") == 0))
{
#ifdef DEBUG
do_debug = 1;