cs_disasm_iter: return false when handle is invalid and do not zero out detail pointer when handling skipdata mode. suggested by @hlide
diff --git a/cs.c b/cs.c
index ff72d77..e2af3b7 100644
--- a/cs.c
+++ b/cs.c
@@ -651,7 +651,7 @@
handle = (struct cs_struct *)(uintptr_t)ud;
if (!handle) {
- return NULL;
+ return false;
}
handle->errnum = CS_ERR_OK;
@@ -714,8 +714,8 @@
// NOTE: if detail mode is OFF, content of detail pointer is irrelevant
// to be sure, zero out content of detail pointer
- if (insn->detail)
- memset(insn->detail, 0, sizeof(cs_detail));
+ //if (insn->detail)
+ // memset(insn->detail, 0, sizeof(cs_detail));
*code += skipdata_bytes;
*size -= skipdata_bytes;