Fix #266 - [ragg2] exit on invalid input (again)

This commit is contained in:
pancake 2013-10-28 02:05:18 +01:00
parent d9724df92c
commit d900345a66
2 changed files with 4 additions and 0 deletions

View File

@ -221,6 +221,8 @@ int main(int argc, char **argv) {
case 'v':
printf ("ragg2 "R2_VERSION" "R2_INCDIR"/sflib\n");
return 0;
default:
return 1;
}
}

View File

@ -61,6 +61,8 @@ R_API int r_hex_str2bin(const char *in, ut8 *out) {
const char *ptr;
ut8 c = 0, d = 0;
if (!in || !*in)
return 0;
if (!memcmp (in, "0x", 2))
in += 2;
for (ptr = in; ; ptr++) {