Clean code

This commit is contained in:
atxr 2024-02-06 20:18:33 +01:00
parent fe7ca3c37a
commit 3636d3fa0d
3 changed files with 11 additions and 4 deletions

View file

@ -1,6 +1,9 @@
#include "libmineziper_zip.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libmineziper_zip.h"
void get_eocd(raw* raw, zip* out)
{
if (raw->size < START_EOCD_SEARCH)
@ -11,7 +14,7 @@ void get_eocd(raw* raw, zip* out)
{
if (strcmp(se, EOCD_SIG) == 0)
{
out->eocd = se;
out->eocd = (EOCD*) se;
out->cdh = (CDH**) malloc(out->eocd->number_of_entries * sizeof(CDH*));
break;
}
@ -30,7 +33,7 @@ void get_cdh(raw* raw, zip* out)
out->cd = raw->buf + out->eocd->off_cdh;
CDH* cdh = out->cd;
CDH* cdh = (CDH*) out->cd;
for (int i = 0; i < out->eocd->number_of_entries; i++)
{
out->cdh[i] = cdh;