]> granicus.if.org Git - sudo/commitdiff
Eliminate dead store found by clang checker.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 15 Jan 2014 13:13:23 +0000 (06:13 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 15 Jan 2014 13:13:23 +0000 (06:13 -0700)
plugins/sudoers/visudo_json.c

index f629435bee6c247df58233c12864257b2f60f7ca..f9381df606655a403fc62cf921988602cd2004d6 100644 (file)
@@ -995,12 +995,12 @@ export_sudoers(const char *sudoers_path, const char *export_path,
            warning(U_("unable to open %s"), sudoers_path);
        goto done;
     }
-    if (strcmp(export_path, "-") == 0) {
-       export_path = "stdout";
-    } else if ((export_fp = fopen(export_path, "w")) == NULL) {
-       if (!quiet)
-           warning(U_("unable to open %s"), export_path);
-       goto done;
+    if (strcmp(export_path, "-") != 0) {
+       if ((export_fp = fopen(export_path, "w")) == NULL) {
+           if (!quiet)
+               warning(U_("unable to open %s"), export_path);
+           goto done;
+       }
     }
     init_parser(sudoers_path, quiet);
     if (sudoersparse() && !parse_error) {