mirror of
https://github.com/emmanuel-marty/lzsa.git
synced 2025-02-14 20:32:04 +00:00
Small cleanup for end-of-data handling in decompression, check commands
This commit is contained in:
parent
a785010448
commit
1353573af1
12
src/main.c
12
src/main.c
@ -381,15 +381,15 @@ static int lzsa_decompress(const char *pszInFilename, const char *pszOutFilename
|
|||||||
(((unsigned int)cBlockSize[2]) << 16);
|
(((unsigned int)cBlockSize[2]) << 16);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nBlockSize = 0xffffff;
|
nBlockSize = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nBlockSize = nFileSize - 4;
|
nBlockSize = nFileSize - 4;
|
||||||
nFileSize = 0xffffff;
|
nFileSize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((nBlockSize & 0x400000) == 0) {
|
if (nBlockSize != 0) {
|
||||||
bool bIsUncompressed = (nBlockSize & 0x800000) != 0;
|
bool bIsUncompressed = (nBlockSize & 0x800000) != 0;
|
||||||
int nDecompressedSize = 0;
|
int nDecompressedSize = 0;
|
||||||
|
|
||||||
@ -581,15 +581,15 @@ static int lzsa_compare(const char *pszInFilename, const char *pszOutFilename, c
|
|||||||
(((unsigned int)cBlockSize[2]) << 16);
|
(((unsigned int)cBlockSize[2]) << 16);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nBlockSize = 0xffffff;
|
nBlockSize = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nBlockSize = nFileSize - 4;
|
nBlockSize = nFileSize - 4;
|
||||||
nFileSize = 0xffffff;
|
nFileSize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((nBlockSize & 0x400000) == 0) {
|
if (nBlockSize != 0) {
|
||||||
bool bIsUncompressed = (nBlockSize & 0x800000) != 0;
|
bool bIsUncompressed = (nBlockSize & 0x800000) != 0;
|
||||||
int nDecompressedSize = 0;
|
int nDecompressedSize = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user