rename @hex_code to @bytes, and move it to next to @size
diff --git a/cs.c b/cs.c
index 7e070a9..c62cab8 100644
--- a/cs.c
+++ b/cs.c
@@ -166,6 +166,8 @@
return CS_ERR_OK;
}
+#define MIN(x, y) ((x) < (y) ? (x) : (y))
+
// fill insn with mnemonic & operands info
static void fill_insn(cs_struct *handle, cs_insn *insn, char *buffer, MCInst *mci,
PostPrinter_t printer, unsigned char *code)
@@ -194,9 +196,9 @@
strncpy(insn->mnemonic, buffer, sizeof(insn->mnemonic) - 1);
insn->mnemonic[sizeof(insn->mnemonic) - 1] = '\0';
-
- // fill the instruction bytes
- memcpy(insn->hex_code, code, MIN(sizeof(insn->hex_code), insn->size));
+
+ // fill the instruction bytes
+ memcpy(insn->bytes, code, MIN(sizeof(insn->bytes), insn->size));
}
cs_err cs_option(csh ud, cs_opt_type type, size_t value)
@@ -267,9 +269,9 @@
if (c == count)
return c;
}
- } else { // face a broken instruction?
+ } else
+ // face a broken instruction?
return c;
- }
}
return c;
@@ -334,10 +336,11 @@
if (count > 0 && c == count)
break;
- } else { // encounter a broken instruction
- // XXX: TODO: JOXEAN continue here
- break;
- }
+ } else {
+ // encounter a broken instruction
+ // XXX: TODO: JOXEAN continue here
+ break;
+ }
}
if (f) {