Add zlib support v2

This commit is contained in:
Gabriele Gristina
2019-06-21 21:56:38 +02:00
parent f4acae6c5f
commit 6cb4abd526
80 changed files with 1122 additions and 417 deletions
+8 -4
View File
@@ -158,17 +158,21 @@ int module_hash_binary_parse (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
{
// note: if module_hash_binary_parse exists, then module_hash_decode is not called
FILE *fp = fopen (hashes->hashfile, "rb");
// FILE *fp = fopen (hashes->hashfile, "rb");
fp_tmp_t fp_t;
if (fp == NULL) return (PARSER_HASH_FILE);
// if (fp == NULL) return (PARSER_HASH_FILE);
if (hc_fopen (&fp_t, hashes->hashfile, "rb") == false) return (PARSER_HASH_FILE);
#define TC_HEADER_SIZE 512
char *in = (char *) hcmalloc (TC_HEADER_SIZE);
const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, fp);
// const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, fp);
const size_t n = hc_fread (in, 1, TC_HEADER_SIZE, &fp_t);
fclose (fp);
// fclose (fp);
hc_fclose (&fp_t);
if (n != TC_HEADER_SIZE) return (PARSER_TC_FILE_SIZE);