Skip to content

Commit

Permalink
fixed asan warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyan4973 committed Dec 18, 2015
1 parent 17d188f commit 6a45835
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions programs/playTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ echo frame concatenation test completed

echo "**** flush write error test **** "

echo "echo foo | $ZSTD > /dev/full"
echo foo | $ZSTD > /dev/full && die "write error not detected!"
echo "echo foo | $ZSTD | $ZSTD -d > /dev/full"
echo foo | $ZSTD | $ZSTD -d > /dev/full && die "write error not detected!"


echo "*** dictionary tests *** "

./datagen > tmpDict
Expand Down
4 changes: 2 additions & 2 deletions programs/zstdcli.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +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*));
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;
Expand Down Expand Up @@ -359,7 +359,7 @@ int main(int argCount, const char** argv)
if (!strcmp(filenameTable[0], stdinmark) && IS_CONSOLE(stdin) ) return badusage(programName);

/* No output filename ==> try to select one automatically (when possible) */
outFileName = filenameTable[1];
if (filenameIdx>=2) outFileName = filenameTable[1];
while (!outFileName) /* while : just to allow break statement */
{
if (!IS_CONSOLE(stdout)) { outFileName=stdoutmark; break; } /* Default to stdout whenever possible (i.e. not a console) */
Expand Down

0 comments on commit 6a45835

Please sign in to comment.