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 */
program_invocation_short_name);
exit(EXIT_FAILURE);
}
+ }
argc -= optind;
argv += optind;
if (argc > 1)
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)
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);
/*
*/
/* 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) {
/*
if (fread(mbuf, sizeof(*mbuf), mbufsize, fp) != mbufsize)
err(EXIT_FAILURE, _("fread failed"));
- (void)close(fd);
+ close(fd);
}