]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fix zstd not erroring on compressing to terminal without forceStdout
authorSean Purcell <me@seanp.xyz>
Thu, 16 Mar 2017 23:06:03 +0000 (16:06 -0700)
committerSean Purcell <me@seanp.xyz>
Thu, 16 Mar 2017 23:06:19 +0000 (16:06 -0700)
programs/zstdcli.c

index ae49da7b1e72d793d65c886406b6a36c452019c2..fc7ca9e36d475452f49db9c9065259ed8fe1a47a 100644 (file)
@@ -635,7 +635,7 @@ int main(int argCount, const char* argv[])
 
     /* Check if input/output defined as console; trigger an error in this case */
     if (!strcmp(filenameTable[0], stdinmark) && IS_CONSOLE(stdin) ) CLEAN_RETURN(badusage(programName));
-    if (outFileName && !strcmp(outFileName, stdoutmark) && IS_CONSOLE(stdout) && strcmp(filenameTable[0], stdinmark) && !(forceStdout && (operation==zom_decompress)))
+    if (outFileName && !strcmp(outFileName, stdoutmark) && IS_CONSOLE(stdout) && !strcmp(filenameTable[0], stdinmark) && !forceStdout && operation!=zom_decompress)
         CLEAN_RETURN(badusage(programName));
 
     /* user-selected output filename, only possible with a single file */