}
void UTIL_createDestinationDirTable(char** dstFilenameTable, const char** filenameTable,
- const unsigned nbFiles, const char* outDirName, const int compressing)
+ const unsigned nbFiles, const char* outDirName)
{
unsigned u;
const char* c;
}
finalPathLen += strlen(filename);
- dstFilenameTable[u] = compressing ?
- (char*) malloc((finalPathLen+6) * sizeof(char)) /* 4 more bytes for .zst suffix */
- : (char*) malloc((finalPathLen+2) * sizeof(char));
+ dstFilenameTable[u] = (char*) malloc((finalPathLen+2) * sizeof(char));
if (!dstFilenameTable[u]) {
UTIL_DISPLAYLEVEL(1, "Unable to allocate space for file destination str\n");
+ free(filename);
continue;
}
int UTIL_checkFilenameCollisions(char** dstFilenameTable, unsigned nbFiles);
/* Populates dstFilenameTable using outDirName concatenated with entries from filenameTable */
void UTIL_createDestinationDirTable(char** dstFilenameTable, const char** filenameTable, const unsigned nbFiles,
- const char* outDirName, const int compressing);
+ const char* outDirName);
void UTIL_freeDestinationFilenameTable(char** dstDirTable, unsigned nbFiles);
U32 UTIL_isLink(const char* infilename);
if (UTIL_isDirectory(outDirName)) {
DISPLAY("Output of files will be in directory: %s\n", outDirName);
dstFilenameTable = (char**)malloc(filenameIdx * sizeof(char*));
- UTIL_createDestinationDirTable(dstFilenameTable, filenameTable, filenameIdx, outDirName, 1);
+ UTIL_createDestinationDirTable(dstFilenameTable, filenameTable, filenameIdx, outDirName);
} else {
DISPLAY("%s is not a directory!\n", outDirName);
CLEAN_RETURN(1);
if (UTIL_isDirectory(outDirName)) {
DISPLAY("Output of files will be in directory: %s\n", outDirName);
dstFilenameTable = (char**)malloc(filenameIdx * sizeof(char*));
- UTIL_createDestinationDirTable(dstFilenameTable, filenameTable, filenameIdx, outDirName, 1);
+ UTIL_createDestinationDirTable(dstFilenameTable, filenameTable, filenameIdx, outDirName);
} else {
DISPLAY("%s is not a directory!\n", outDirName);
CLEAN_RETURN(1);