Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/Sparc/SparcInstPrinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ void Sparc_printInst(MCInst *MI, SStream *O, void *Info)
mnem = printAliasInstr(MI, O, Info);
if (mnem) {
// fixup instruction id due to the change in alias instruction
strncpy(instr, mnem, sizeof(instr));
strncpy(instr, mnem, sizeof(instr) - 1);
instr[sizeof(instr) - 1] = '\0';
// does this contains hint with a coma?
p = strchr(instr, ',');
Expand Down
2 changes: 1 addition & 1 deletion cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ static void fill_insn(struct cs_struct *handle, cs_insn *insn, char *buffer, MCI
while(tmp) {
if (tmp->insn.id == insn->id) {
// found this instruction, so copy its mnemonic
(void)strncpy(insn->mnemonic, tmp->insn.mnemonic, sizeof(insn->mnemonic) - 1);
(void)strncpy(insn->mnemonic, tmp->insn.mnemonic, sizeof(insn->mnemonic));
insn->mnemonic[sizeof(insn->mnemonic) - 1] = '\0';
break;
}
Expand Down