Skip to content

Commit

Permalink
fixed visual warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyan4973 committed Dec 18, 2015
1 parent 6a45835 commit 324a3e2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions programs/zstdcli.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ int main(int argCount, const char** argv)
multiple=0,
operationResult=0;
unsigned cLevel = 1;
const char** filenameTable = NULL;
const char** filenameTable = (const char**)malloc(argCount * sizeof(const char*)); /* argCount >= 1 */
unsigned filenameIdx = 0;
const char* programName = argv[0];
const char* outFileName = NULL;
Expand All @@ -192,9 +192,7 @@ int main(int argCount, const char** argv)

/* init */
(void)rangeBench; /* not used when ZSTD_NOBENCH set */
filenameTable = (const char**)malloc(argCount * sizeof(const char*)); /* argCount >= 1 */
if (filenameTable==NULL) { DISPLAY("not enough memory\n"); exit(1); }
memset(filenameTable, 0, argCount * sizeof(const char*));
displayOut = stderr;
/* Pick out program name from path. Don't rely on stdlib because of conflicting behavior */
for (i = (int)strlen(programName); i > 0; i--) { if (programName[i] == '/') { i++; break; } }
Expand Down Expand Up @@ -424,6 +422,6 @@ int main(int argCount, const char** argv)
_end:
if (main_pause) waitEnter();
free(dynNameSpace);
free(filenameTable);
free((void*)filenameTable);
return operationResult;
}

0 comments on commit 324a3e2

Please sign in to comment.