Fix #245 - rasm2 -d -f inconsistence

This commit is contained in:
pancake 2013-11-14 04:01:48 +01:00
parent a37a166c50
commit 816560dffe

View File

@ -330,7 +330,11 @@ int main(int argc, char *argv[]) {
length -= skip;
}
}
if (!bin || !dis) buf[strlen (buf)-1]='\0';
if (!bin || !dis) {
int buflen = strlen (buf);
if (buf[buflen]=='\n')
buf[buflen-1]='\0';
}
if (dis) ret = rasm_disasm (buf, offset,
length, a->bits, ascii, bin, dis-1);
else ret = rasm_asm (buf, offset, length, a->bits, bin);