Fix rabin2 test

This commit is contained in:
Álvaro Felipe Melchor 2015-10-17 17:33:17 +02:00 committed by pancake
parent 6df5031bf7
commit b81cb74923
2 changed files with 4 additions and 4 deletions

View File

@ -4,8 +4,9 @@
/* TODO: do it more beautiful with structs and not spaguetis */
R_API int r_hash_calculate(RHash *ctx, ut64 algobit, const ut8 *buf, int len) {
if (len <= 0)
return 0;
if (len < 0) return 0;
if (len == 0) return r_hash_size (algobit);
if (algobit & R_HASH_MD4) {
r_hash_do_md4 (ctx, buf, len);
return R_HASH_SIZE_MD4;

View File

@ -171,8 +171,7 @@ R_API char *r_hash_to_string(RHash *ctx, const char *name, const ut8 *data, int
char *digest_hex = NULL;
RHash *myctx = NULL;
int i, digest_size;
if (!algo || !name || !data || len < 0) {
if (!algo || !data) {
return NULL;
}
if (!ctx) {