fix crash in nz assembler

This commit is contained in:
Álvaro Felipe Melchor 2016-07-26 22:08:25 +02:00
parent e62aac49f3
commit 3c8066ce57
2 changed files with 3 additions and 3 deletions

View File

@ -1668,7 +1668,7 @@ LookupTable oplookup[] = {
{"xor", &opxor, 0},
{"xsetbv", NULL, 0x0f01d1, 3},
{"test", &optest, 0},
{ NULL, NULL, 0}
{{0}, NULL, 0, 0}
};
static x86newTokenType getToken(const char *str, size_t *begin, size_t *end) {
@ -2036,7 +2036,7 @@ static int assemble(RAsm *a, RAsmOp *ao, const char *str) {
parseOpcode (a, op, &instr);
for (lt_ptr = oplookup; lt_ptr - oplookup < sizeof (oplookup); ++lt_ptr) {
if (!strcasecmp (instr.mnemonic, lt_ptr->mnemonic)) {
if (!r_str_casestr (instr.mnemonic, lt_ptr->mnemonic)) {
if (lt_ptr->opcode > 0) {
ut8 *ptr = (ut8 *)&lt_ptr->opcode;
int i = 0;

View File

@ -1553,7 +1553,7 @@ R_API int r_str_len_utf8char (const char *s, int left) {
return i;
}
R_API int r_str_len_utf8 (const char *s) {
R_API int r_str_len_utf8(const char *s) {
int i = 0, j = 0;
while (s[i]) {
if ((s[i] & 0xc0) != 0x80) j++;