check the correct variable to want about --stderr failures properly
authorDaniel Stenberg <daniel@haxx.se>
Sat, 31 Mar 2007 21:28:38 +0000 (21:28 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 31 Mar 2007 21:28:38 +0000 (21:28 +0000)
CID 18 by the coverity.com scan

src/main.c

index 5a95351..72f28e3 100644 (file)
@@ -1769,7 +1769,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
       case 'v': /* --stderr */
         if(strcmp(nextarg, "-")) {
           FILE *newfile = fopen(nextarg, "wt");
-          if(!config->errors)
+          if(!newfile)
             warnf(config, "Failed to open %s!\n", nextarg);
           else {
             config->errors = newfile;