Find cdh in zip
This commit is contained in:
parent
0b199784ec
commit
4692b1e643
2 changed files with 35 additions and 2 deletions
20
libmineziper/src/libmineziper_zip.c
Normal file
20
libmineziper/src/libmineziper_zip.c
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#include "libmineziper_zip.h"
|
||||
#include <string.h>
|
||||
|
||||
void find_cdh(raw* raw, zip* out)
|
||||
{
|
||||
if (raw->size < START_CDH_SEARCH)
|
||||
return;
|
||||
|
||||
char* se = raw->buf + raw->size - START_CDH_SEARCH;
|
||||
while (se > raw->buf)
|
||||
{
|
||||
if (strcmp(se, CDH_MB) == 0)
|
||||
{
|
||||
zip->cdh = se;
|
||||
break;
|
||||
}
|
||||
|
||||
se--;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue