switch almost all FILE ops, potfile is the only missing

This commit is contained in:
Gabriele Gristina
2019-06-26 19:06:46 +02:00
parent 084ea69b3b
commit 398c89c75c
83 changed files with 1178 additions and 783 deletions

View File

@@ -158,17 +158,17 @@ 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
fp_tmp_t fp_t;
HCFILE fp;
if (hc_fopen (&fp_t, hashes->hashfile, "rb") == false) return (PARSER_HASH_FILE);
if (hc_fopen (&fp, 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_t);
const size_t n = hc_fread_compress (in, 1, TC_HEADER_SIZE, &fp);
hc_fclose (&fp_t);
hc_fclose (&fp);
if (n != TC_HEADER_SIZE) return (PARSER_TC_FILE_SIZE);