#define emith_abijump_reg_c(cond, r) \
emith_abijump_reg(r)
#define emith_abicall(target) do { \
- emith_move_r_imm(CR, target); \
+ emith_move_r_ptr_imm(CR, target); \
emith_branch(MIPS_JALR(LR, CR)); \
} while (0)
#define emith_abicall_cond(cond, target) \
\r
#define CHECKED_WRITE(name,len,data) { \\r
if (PicoStateProgressCB && name < CHUNK_DEFAULT_COUNT && chunk_names[name]) { \\r
- strncpy(sbuff + 9, chunk_names[name], sizeof(sbuff) - 9); \\r
+ strncpy(sbuff + 9, chunk_names[name], sizeof(sbuff)-1 - 9); \\r
+ sbuff[sizeof(sbuff)-1] = '\0'; \\r
PicoStateProgressCB(sbuff); \\r
} \\r
if (data == buf2 && len > CHUNK_LIMIT_W) \\r
\r
#define CHECKED_WRITE_BUFF(name,buff) { \\r
if (PicoStateProgressCB && name < CHUNK_DEFAULT_COUNT && chunk_names[name]) { \\r
- strncpy(sbuff + 9, chunk_names[name], sizeof(sbuff) - 9); \\r
+ strncpy(sbuff + 9, chunk_names[name], sizeof(sbuff)-1 - 9); \\r
+ sbuff[sizeof(sbuff)-1] = '\0'; \\r
PicoStateProgressCB(sbuff); \\r
} \\r
if (!write_chunk(name, sizeof(buff), &buff, file)) \\r
const char **names = (const char **)me->data;
for (t = 0; names[t] != NULL; t++) {
if (*(int *)me->var == t) {
- strncpy(line, names[t], sizeof(line));
+ strncpy(line, names[t], sizeof(line)-1);
+ line[sizeof(line)-1] = '\0';
goto write_line;
}
}
}
else if (me->generate_name != NULL) {
- strncpy(line, me->generate_name(0, &dummy), sizeof(line));
+ strncpy(line, me->generate_name(0, &dummy), sizeof(line)-1);
+ line[sizeof(line)-1] = '\0';
goto write_line;
}
else
tmp++;
mystrip(tmp);
- len = sizeof(rom_fname_loaded);
+ len = sizeof(rom_fname_loaded)-1;
strncpy(rom_fname_loaded, tmp, len);
- rom_fname_loaded[len-1] = 0;
+ rom_fname_loaded[len] = 0;
ret = 0;
break;
}
insn = *(unsigned long *)addr;
printf(" %08lx %08lx ", (long)addr, insn);
- if(disasm((unsigned)addr, insn, buf, sizeof(buf), &symaddr))
+ if(disasm((uintptr_t)addr, insn, buf, sizeof(buf), &symaddr))
{
if (symaddr)
name = lookup_name((void *)symaddr);