mirror of
https://github.com/emmanuel-marty/lzsa.git
synced 2025-01-03 19:30:35 +00:00
Merge pull request #29 from francois-berder/master
Various improvements -- thank you!
This commit is contained in:
commit
b92a003338
@ -96,6 +96,6 @@ int lzsa_dictionary_load(const char *pszDictionaryFilename, void **ppDictionaryD
|
||||
void lzsa_dictionary_free(void **ppDictionaryData) {
|
||||
if (*ppDictionaryData) {
|
||||
free(*ppDictionaryData);
|
||||
ppDictionaryData = NULL;
|
||||
*ppDictionaryData = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -277,8 +277,10 @@ int comparestream_open(lzsa_stream_t *stream, const char *pszCompareFilename, co
|
||||
stream->close = comparestream_close;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
else {
|
||||
free(pCompareStream);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static int do_compare(const char *pszInFilename, const char *pszOutFilename, const char *pszDictionaryFilename, const unsigned int nOptions, int nFormatVersion) {
|
||||
@ -1052,7 +1054,9 @@ int main(int argc, char **argv) {
|
||||
if (cCommand == 'z') {
|
||||
int nResult = do_compress(pszInFilename, pszOutFilename, pszDictionaryFilename, nOptions, nMinMatchSize, nFormatVersion);
|
||||
if (nResult == 0 && bVerifyCompression) {
|
||||
nResult = do_compare(pszOutFilename, pszInFilename, pszDictionaryFilename, nOptions, nFormatVersion);
|
||||
return do_compare(pszOutFilename, pszInFilename, pszDictionaryFilename, nOptions, nFormatVersion);
|
||||
} else {
|
||||
return nResult;
|
||||
}
|
||||
}
|
||||
else if (cCommand == 'd') {
|
||||
|
Loading…
Reference in New Issue
Block a user