diff --git a/AltairZ80/m68k/m68kfpu.c b/AltairZ80/m68k/m68kfpu.c index 0d0973e0..793e6e44 100644 --- a/AltairZ80/m68k/m68kfpu.c +++ b/AltairZ80/m68k/m68kfpu.c @@ -1,8 +1,7 @@ #include #include #include - -extern void exit(int); +#include static void fatalerror(const char *format, ...) { va_list ap; @@ -128,7 +127,9 @@ static inline floatx80 load_pack_float80(uint32 ea) *ch++ = (char)(((dw1 >> 16) & 0xf) + '0'); *ch = '\0'; - sscanf(str, "%le", &tmp); + if (sscanf(str, "%le", &tmp) == 1) { + result = double_to_fx80(tmp); + } result = double_to_fx80(tmp); @@ -596,7 +597,7 @@ static uint64 READ_EA_64(int ea) static floatx80 READ_EA_FPE(int mode, int reg, uint32 di_mode_ea) { - floatx80 fpr; + floatx80 fpr = { 0 }; switch (mode) { @@ -659,7 +660,7 @@ static floatx80 READ_EA_FPE(int mode, int reg, uint32 di_mode_ea) static floatx80 READ_EA_PACK(int ea) { - floatx80 fpr; + floatx80 fpr = { 0 }; int mode = (ea >> 3) & 0x7; int reg = (ea & 0x7); @@ -1052,7 +1053,7 @@ static void fpgen_rm_reg(uint16 w2) int src = (w2 >> 10) & 0x7; int dst = (w2 >> 7) & 0x7; int opmode = w2 & 0x7f; - floatx80 source; + floatx80 source = { 0 }; // fmovecr #$f, fp0 f200 5c0f