This commit is contained in:
@@ -126,7 +126,6 @@ static sxi32 InternFormat(ProcConsumer xConsumer, void *pUserData, const char *z
|
||||
char prefix; /* Prefix character."+" or "-" or " " or '\0'.*/
|
||||
sxu8 errorflag = 0; /* True if an error is encountered */
|
||||
sxu8 xtype; /* Conversion paradigm */
|
||||
char *zExtra;
|
||||
static char spaces[] = " ";
|
||||
#define etSPACESIZE ((int)sizeof(spaces)-1)
|
||||
#ifndef SX_OMIT_FLOATINGPOINT
|
||||
@@ -250,7 +249,6 @@ static sxi32 InternFormat(ProcConsumer xConsumer, void *pUserData, const char *z
|
||||
break;
|
||||
}
|
||||
}
|
||||
zExtra = 0;
|
||||
/*
|
||||
** At this point, variables are initialized as follows:
|
||||
**
|
||||
|
@@ -207,25 +207,24 @@ static sxi32 ArchiveHashInstallEntry(SyArchive *pArch, SyArchiveEntry *pEntry) {
|
||||
*/
|
||||
static sxi32 ParseEndOfCentralDirectory(SyArchive *pArch, const unsigned char *zBuf) {
|
||||
sxu32 nMagic = 0; /* cc -O6 warning */
|
||||
sxi32 rc;
|
||||
/* Sanity check */
|
||||
rc = SyLittleEndianUnpack32(&nMagic, zBuf, sizeof(sxu32));
|
||||
if(/* rc != SXRET_OK || */nMagic != SXZIP_END_CENTRAL_MAGIC) {
|
||||
SyLittleEndianUnpack32(&nMagic, zBuf, sizeof(sxu32));
|
||||
if(nMagic != SXZIP_END_CENTRAL_MAGIC) {
|
||||
return SXERR_CORRUPT;
|
||||
}
|
||||
/* # of entries */
|
||||
rc = SyLittleEndianUnpack16((sxu16 *)&pArch->nEntry, &zBuf[8], sizeof(sxu16));
|
||||
if(/* rc != SXRET_OK || */ pArch->nEntry > SXI16_HIGH /* SXU16_HIGH */) {
|
||||
SyLittleEndianUnpack16((sxu16 *)&pArch->nEntry, &zBuf[8], sizeof(sxu16));
|
||||
if(pArch->nEntry > SXI16_HIGH /* SXU16_HIGH */) {
|
||||
return SXERR_CORRUPT;
|
||||
}
|
||||
/* Size of central directory */
|
||||
rc = SyLittleEndianUnpack32(&pArch->nCentralSize, &zBuf[12], sizeof(sxu32));
|
||||
if(/*rc != SXRET_OK ||*/ pArch->nCentralSize > SXI32_HIGH) {
|
||||
SyLittleEndianUnpack32(&pArch->nCentralSize, &zBuf[12], sizeof(sxu32));
|
||||
if(pArch->nCentralSize > SXI32_HIGH) {
|
||||
return SXERR_CORRUPT;
|
||||
}
|
||||
/* Starting offset of central directory */
|
||||
rc = SyLittleEndianUnpack32(&pArch->nCentralOfft, &zBuf[16], sizeof(sxu32));
|
||||
if(/*rc != SXRET_OK ||*/ pArch->nCentralSize > SXI32_HIGH) {
|
||||
SyLittleEndianUnpack32(&pArch->nCentralOfft, &zBuf[16], sizeof(sxu32));
|
||||
if(pArch->nCentralSize > SXI32_HIGH) {
|
||||
return SXERR_CORRUPT;
|
||||
}
|
||||
return SXRET_OK;
|
||||
@@ -241,6 +240,7 @@ static sxi32 GetCentralDirectoryEntry(SyArchive *pArch, SyArchiveEntry *pEntry,
|
||||
sxi32 rc;
|
||||
nDosDate = nDosTime = 0; /* cc -O6 warning */
|
||||
SXUNUSED(pArch);
|
||||
// (void)pArch;
|
||||
/* Sanity check */
|
||||
rc = SyLittleEndianUnpack32(&nMagic, zCentral, sizeof(sxu32));
|
||||
if(/* rc != SXRET_OK || */ nMagic != SXZIP_CENTRAL_MAGIC) {
|
||||
|
@@ -613,7 +613,6 @@ static sxi32 MemBackendRelease(SyMemBackend *pBackend) {
|
||||
return SXRET_OK;
|
||||
}
|
||||
PH7_PRIVATE sxi32 SyMemBackendRelease(SyMemBackend *pBackend) {
|
||||
sxi32 rc;
|
||||
#if defined(UNTRUST)
|
||||
if(SXMEM_BACKEND_CORRUPT(pBackend)) {
|
||||
return SXERR_INVALID;
|
||||
@@ -622,7 +621,7 @@ PH7_PRIVATE sxi32 SyMemBackendRelease(SyMemBackend *pBackend) {
|
||||
if(pBackend->pMutexMethods) {
|
||||
SyMutexEnter(pBackend->pMutexMethods, pBackend->pMutex);
|
||||
}
|
||||
rc = MemBackendRelease(&(*pBackend));
|
||||
MemBackendRelease(&(*pBackend));
|
||||
if(pBackend->pMutexMethods) {
|
||||
SyMutexLeave(pBackend->pMutexMethods, pBackend->pMutex);
|
||||
SyMutexRelease(pBackend->pMutexMethods, pBackend->pMutex);
|
||||
|
@@ -150,17 +150,17 @@ sxu32 Systrcpy(char *zDest, sxu32 nDestLen, const char *zSrc, sxu32 nLen) {
|
||||
PH7_PRIVATE char *SyStrtok(char *str, const char *sep) {
|
||||
static int pos;
|
||||
static char *s;
|
||||
int i = 0, j = 0;
|
||||
int i = 0;
|
||||
int start = pos;
|
||||
/* Copy the string for further SyStrtok() calls */
|
||||
if(str != NULL) {
|
||||
s = str;
|
||||
}
|
||||
while(s[pos] != '\0') {
|
||||
j = 0;
|
||||
i = 0;
|
||||
/* Compare of one of the delimiter matches the character in the string */
|
||||
while(sep[j] != '\0') {
|
||||
if(s[pos] == sep[j]) {
|
||||
while(sep[i] != '\0') {
|
||||
if(s[pos] == sep[i]) {
|
||||
/* Replace the delimter by \0 to break the string */
|
||||
s[pos] = '\0';
|
||||
pos++;
|
||||
@@ -173,7 +173,7 @@ PH7_PRIVATE char *SyStrtok(char *str, const char *sep) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
j++;
|
||||
i++;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user