Fix unsigned typos

This commit is contained in:
atxr 2024-02-28 03:21:08 +01:00
parent 8ca61905e1
commit c06790d5e0
2 changed files with 8 additions and 7 deletions

View file

@ -25,8 +25,8 @@ typedef struct LFH
int crc32;
int compressed_size;
int uncompressed_size;
short filename_length;
short extraf_length;
unsigned short filename_length;
unsigned short extraf_length;
} LFH;
typedef struct CDH
@ -41,9 +41,9 @@ typedef struct CDH
int crc32;
int compressed_size;
int uncompressed_size;
short filename_length;
short extraf_length;
short file_comment_length;
unsigned short filename_length;
unsigned short extraf_length;
unsigned short file_comment_length;
short disk_number_start;
short internal_file_attributes;
int external_file_attributes;

View file

@ -62,8 +62,9 @@ void get_cdh(zip* z)
z->lfh_off[i] = cdh->off_lfh;
z->cdh_filename_length[i] = cdh->filename_length;
cdh = (CDH*) (((char*) cdh) + sizeof(CDH) + cdh->filename_length +
cdh->extraf_length + cdh->file_comment_length);
unsigned short len = cdh->filename_length + cdh->extraf_length +
cdh->file_comment_length;
cdh = (CDH*) (((char*) cdh) + sizeof(CDH) + len);
}
}