JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
correct programme name
[st.git] / std.c
diff --git a/std.c b/std.c
index daf759e..2ce1722 100644 (file)
--- a/std.c
+++ b/std.c
@@ -1,5 +1,4 @@
 /* See LICENSE file for copyright and license details. */
-#include "util.h"
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <ctype.h>
@@ -265,24 +264,18 @@ ungetch(int c) {
 int
 main(int argc, char *argv[]) {
        fd_set rfds;
-       int r;
 
-       if(argc == 2 && !strcmp("-v", argv[1])) {
-               fprintf(stderr, "std-"VERSION", © 2008 Matthias-Christian Ott\n");
-               exit(EXIT_SUCCESS);
-       }
-       else if(argc == 1) {
-               fprintf(stderr, "usage: st [-v]\n");
-               exit(EXIT_FAILURE);
-       }
+       if(argc == 2 && !strcmp("-v", argv[1]))
+               errx(EXIT_SUCCESS, "std-"VERSION", © 2008 Matthias-Christian Ott");
+       else if(argc == 1)
+               errx(EXIT_FAILURE, "usage: std [-v]");
        getpty();
        shell();
        FD_ZERO(&rfds);
        FD_SET(STDIN_FILENO, &rfds);
        FD_SET(ptm, &rfds);
        for(;;) {
-               r = select(ptm + 1, &rfds, NULL, NULL, NULL);
-               if(r == -1)
+               if(select(ptm + 1, &rfds, NULL, NULL, NULL) == -1)
                        err(EXIT_FAILURE, "cannot select");
                if(FD_ISSET(ptm, &rfds)) {
                        do {