]> err.no Git - util-linux/commitdiff
wall: fix coding style
authorKarel Zak <kzak@redhat.com>
Fri, 10 Dec 2010 15:22:29 +0000 (16:22 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 10 Dec 2010 15:22:29 +0000 (16:22 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/wall.c

index 383873b58bf4280da1f42f0561fd01ffe2d577b1..2ecce126b5fc291bf2f3d398fc7abec68fd284c0 100644 (file)
@@ -95,7 +95,7 @@ main(int argc, char **argv) {
         bindtextdomain(PACKAGE, LOCALEDIR);
         textdomain(PACKAGE);
 
-       while ((ch = getopt(argc, argv, "n")) != -1)
+       while ((ch = getopt(argc, argv, "n")) != -1) {
                switch (ch) {
                case 'n':
                        /* undoc option for shutdown: suppress banner */
@@ -109,6 +109,7 @@ usage:
                                        program_invocation_short_name);
                        exit(EXIT_FAILURE);
                }
+       }
        argc -= optind;
        argv += optind;
        if (argc > 1)
@@ -159,11 +160,11 @@ makemsg(fname)
                lbuf[MAXHOSTNAMELEN + 320],
                tmpname[sizeof(_PATH_TMP) + 20];
 
-       (void)sprintf(tmpname, "%s/wall.XXXXXX", _PATH_TMP);
+       sprintf(tmpname, "%s/wall.XXXXXX", _PATH_TMP);
        if (!(fd = mkstemp(tmpname)) || !(fp = fdopen(fd, "r+")))
                errx(EXIT_FAILURE, _("can't open temporary file"));
 
-       (void)unlink(tmpname);
+       unlink(tmpname);
 
        if (!nobanner) {
                if (!(whom = getlogin()) || !*whom)
@@ -173,8 +174,8 @@ makemsg(fname)
                where = ttyname(2);
                if (!where || strlen(where) > 100)
                        where = "somewhere";
-               (void)gethostname(hostname, sizeof(hostname));
-               (void)time(&now);
+               gethostname(hostname, sizeof(hostname));
+               time(&now);
                lt = localtime(&now);
 
                /*
@@ -186,15 +187,15 @@ makemsg(fname)
                 */
                /* snprintf is not always available, but the sprintf's here
                   will not overflow as long as %d takes at most 100 chars */
-               (void)fprintf(fp, "\r%79s\r\n", " ");
-               (void)sprintf(lbuf, _("Broadcast Message from %s@%s"),
+               fprintf(fp, "\r%79s\r\n", " ");
+               sprintf(lbuf, _("Broadcast Message from %s@%s"),
                              whom, hostname);
-               (void)fprintf(fp, "%-79.79s\007\007\r\n", lbuf);
-               (void)sprintf(lbuf, "        (%s) at %d:%02d ...",
+               fprintf(fp, "%-79.79s\007\007\r\n", lbuf);
+               sprintf(lbuf, "        (%s) at %d:%02d ...",
                              where, lt->tm_hour, lt->tm_min);
-               (void)fprintf(fp, "%-79.79s\r\n", lbuf);
+               fprintf(fp, "%-79.79s\r\n", lbuf);
        }
-       (void)fprintf(fp, "%79s\r\n", " ");
+       fprintf(fp, "%79s\r\n", " ");
 
        if (fname) {
                /*
@@ -237,5 +238,5 @@ makemsg(fname)
        if (fread(mbuf, sizeof(*mbuf), mbufsize, fp) != mbufsize)
                err(EXIT_FAILURE, _("fread failed"));
 
-       (void)close(fd);
+       close(fd);
 }