diff --git a/AltairZ80/altairz80_sys.c b/AltairZ80/altairz80_sys.c index dd327a61..fca85329 100644 --- a/AltairZ80/altairz80_sys.c +++ b/AltairZ80/altairz80_sys.c @@ -427,11 +427,11 @@ static int32 DAsm(char *S, const uint32 *val, const int32 useZ80Mnemonics, const strncpy(R, T, T1 - T); R[T1 - T] = '\0'; printHex2(H, val[B++]); - strcat(R, H); - strcat(R, T1 + 1); /* ok, since T1 is a short sub-string coming from one of the tables */ + strlcat(R, H, sizeof (R)); + strlcat(R, T1 + 1, sizeof (R)); /* ok, since T1 is a short sub-string coming from one of the tables */ } else - strcpy(R, T); /* ok, since T is a short string coming from one of the tables */ + strlcpy(R, T, sizeof (R)); /* ok, since T is a short string coming from one of the tables */ if ( (P = strchr(R, '%')) ) { *P = C; if ( (P = strchr(P + 1, '%')) ) diff --git a/AltairZ80/flashwriter2.c b/AltairZ80/flashwriter2.c index db99039e..1a03b5c8 100644 --- a/AltairZ80/flashwriter2.c +++ b/AltairZ80/flashwriter2.c @@ -54,7 +54,7 @@ extern int32 sio0d(const int32 port, const int32 io, const int32 data); extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, int32 (*routine)(const int32, const int32, const int32), uint8 unmap); -static char ansibuf[10]; +static char ansibuf[32]; #define FW2_MAX_BOARDS 4 #define UNIT_V_FW2_VERBOSE (UNIT_V_UF + 1) /* verbose mode, i.e. show error messages */ diff --git a/AltairZ80/m68kdasm.c b/AltairZ80/m68kdasm.c index d5c8f64f..5b64fc78 100755 --- a/AltairZ80/m68kdasm.c +++ b/AltairZ80/m68kdasm.c @@ -313,7 +313,7 @@ static char* make_signed_hex_str_32(uint val) /* make string of immediate value */ static char* get_imm_str_s(uint size) { - static char str[15]; + static char str[32]; if(size == 0) sprintf(str, "#%s", make_signed_hex_str_8(read_imm_8())); else if(size == 1) @@ -325,7 +325,7 @@ static char* get_imm_str_s(uint size) static char* get_imm_str_u(uint size) { - static char str[15]; + static char str[32]; if(size == 0) sprintf(str, "#$%x", read_imm_8() & 0xff); else if(size == 1) @@ -3253,7 +3253,7 @@ unsigned int m68k_disassemble(char* str_buff, unsigned int pc, unsigned int cpu_ char* m68ki_disassemble_quick(unsigned int pc, unsigned int cpu_type) { - static char buff[100]; + static char buff[200]; buff[0] = 0; m68k_disassemble(buff, pc, cpu_type); return buff;