mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-04 19:47:31 +00:00
Fix rabin2 test
This commit is contained in:
parent
6df5031bf7
commit
b81cb74923
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user