removed all stupid (void)

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1034 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1996-11-17 20:23:48 +00:00
parent 239db0f710
commit 6202f22614
40 changed files with 544 additions and 544 deletions

View File

@@ -817,15 +817,15 @@ qprintf(const Char *str, Char *s)
{
Char *p;
(void)printf("%s:\n", str);
printf("%s:\n", str);
for (p = s; *p; p++)
(void)printf("%c", CHAR(*p));
(void)printf("\n");
printf("%c", CHAR(*p));
printf("\n");
for (p = s; *p; p++)
(void)printf("%c", *p & M_PROTECT ? '"' : ' ');
(void)printf("\n");
printf("%c", *p & M_PROTECT ? '"' : ' ');
printf("\n");
for (p = s; *p; p++)
(void)printf("%c", ismeta(*p) ? '_' : ' ');
(void)printf("\n");
printf("%c", ismeta(*p) ? '_' : ' ');
printf("\n");
}
#endif

View File

@@ -91,7 +91,7 @@ setpeer(int argc, char **argv)
return;
}
if (argc < 2)
(void) another(&argc, &argv, "to");
another(&argc, &argv, "to");
if (argc < 2 || argc > 3) {
printf("usage: %s host-name [port]\n", argv[0]);
code = -1;
@@ -119,14 +119,14 @@ setpeer(int argc, char **argv)
/*
* Set up defaults for FTP.
*/
(void) strcpy(typename, "ascii"), type = TYPE_A;
strcpy(typename, "ascii"), type = TYPE_A;
curtype = TYPE_A;
(void) strcpy(formname, "non-print"), form = FORM_N;
(void) strcpy(modename, "stream"), mode = MODE_S;
(void) strcpy(structname, "file"), stru = STRU_F;
(void) strcpy(bytename, "8"), bytesize = 8;
strcpy(formname, "non-print"), form = FORM_N;
strcpy(modename, "stream"), mode = MODE_S;
strcpy(structname, "file"), stru = STRU_F;
strcpy(bytename, "8"), bytesize = 8;
if (autologin)
(void) login(argv[1]);
login(argv[1]);
#if defined(unix) && NBBY == 8
/*
@@ -165,7 +165,7 @@ setpeer(int argc, char **argv)
* for text files unless changed by the user.
*/
type = 0;
(void) strcpy(typename, "binary");
strcpy(typename, "binary");
if (overbose)
printf("Using %s mode to transfer files.\n",
typename);
@@ -238,7 +238,7 @@ settype(int argc, char **argv)
else
comret = command("TYPE %s", p->t_mode);
if (comret == COMPLETE) {
(void) strcpy(typename, p->t_name);
strcpy(typename, p->t_name);
curtype = type = p->t_type;
}
}
@@ -408,7 +408,7 @@ mabort(int signo)
int ointer;
printf("\n");
(void) fflush(stdout);
fflush(stdout);
if (mflag && fromatty) {
ointer = interactive;
interactive = 1;
@@ -441,7 +441,7 @@ mput(int argc, char **argv)
mname = argv[0];
mflag = 1;
oldintr = signal(SIGINT, mabort);
(void) setjmp(jabort);
setjmp(jabort);
if (proxy) {
char *cp, *tp2, tmpbuf[MaxPathLen];
@@ -487,7 +487,7 @@ mput(int argc, char **argv)
}
}
}
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
mflag = 0;
return;
}
@@ -539,7 +539,7 @@ mput(int argc, char **argv)
}
globfree(&gl);
}
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
mflag = 0;
}
@@ -547,14 +547,14 @@ void
reget(int argc, char **argv)
{
(void) getit(argc, argv, 1, "r+w");
getit(argc, argv, 1, "r+w");
}
void
get(int argc, char **argv)
{
(void) getit(argc, argv, 0, restart_point ? "r+w" : "w" );
getit(argc, argv, 0, restart_point ? "r+w" : "w" );
}
/*
@@ -681,7 +681,7 @@ mget(int argc, char **argv)
mname = argv[0];
mflag = 1;
oldintr = signal(SIGINT, mabort);
(void) setjmp(jabort);
setjmp(jabort);
while ((cp = remglob(argv,proxy)) != NULL) {
if (*cp == '\0') {
mflag = 0;
@@ -713,7 +713,7 @@ mget(int argc, char **argv)
}
}
}
(void) signal(SIGINT,oldintr);
signal(SIGINT,oldintr);
mflag = 0;
}
@@ -733,7 +733,7 @@ remglob(char **argv, int doswitch)
}
else {
if (ftemp) {
(void) fclose(ftemp);
fclose(ftemp);
ftemp = NULL;
}
}
@@ -747,8 +747,8 @@ remglob(char **argv, int doswitch)
return (cp);
}
if (ftemp == NULL) {
(void) strcpy(temp, _PATH_TMP);
(void) mktemp(temp);
strcpy(temp, _PATH_TMP);
mktemp(temp);
oldverbose = verbose, verbose = 0;
oldhash = hash, hash = 0;
if (doswitch) {
@@ -761,14 +761,14 @@ remglob(char **argv, int doswitch)
}
verbose = oldverbose; hash = oldhash;
ftemp = fopen(temp, "r");
(void) unlink(temp);
unlink(temp);
if (ftemp == NULL) {
printf("can't find list of remote files, oops\n");
return (NULL);
}
}
if (fgets(buf, sizeof (buf), ftemp) == NULL) {
(void) fclose(ftemp), ftemp = NULL;
fclose(ftemp), ftemp = NULL;
return (NULL);
}
if ((cp = strchr(buf, '\n')) != NULL)
@@ -978,7 +978,7 @@ cd(int argc, char **argv)
if (command("CWD %s", argv[1]) == ERROR && code == 500) {
if (verbose)
printf("CWD command not recognized, trying XCWD\n");
(void) command("XCWD %s", argv[1]);
command("XCWD %s", argv[1]);
}
}
@@ -1026,7 +1026,7 @@ delete(int argc, char **argv)
code = -1;
return;
}
(void) command("DELE %s", argv[1]);
command("DELE %s", argv[1]);
}
/*
@@ -1047,14 +1047,14 @@ mdelete(int argc, char **argv)
mname = argv[0];
mflag = 1;
oldintr = signal(SIGINT, mabort);
(void) setjmp(jabort);
setjmp(jabort);
while ((cp = remglob(argv,0)) != NULL) {
if (*cp == '\0') {
mflag = 0;
continue;
}
if (mflag && confirm(argv[0], cp)) {
(void) command("DELE %s", cp);
command("DELE %s", cp);
if (!mflag && fromatty) {
ointer = interactive;
interactive = 1;
@@ -1065,7 +1065,7 @@ mdelete(int argc, char **argv)
}
}
}
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
mflag = 0;
}
@@ -1085,7 +1085,7 @@ usage:
return;
}
if (command("RNFR %s", argv[1]) == CONTINUE)
(void) command("RNTO %s", argv[2]);
command("RNTO %s", argv[2]);
}
/*
@@ -1150,7 +1150,7 @@ usage:
mname = argv[0];
mflag = 1;
oldintr = signal(SIGINT, mabort);
(void) setjmp(jabort);
setjmp(jabort);
for (i = 1; mflag && i < argc-1; ++i) {
*mode = (i == 1) ? 'w' : 'a';
recvrequest(cmd, dest, argv[i], mode, 0);
@@ -1163,7 +1163,7 @@ usage:
interactive = ointer;
}
}
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
mflag = 0;
}
@@ -1183,22 +1183,22 @@ shell(int argc, char **argv)
old2 = signal (SIGQUIT, SIG_IGN);
if ((pid = fork()) == 0) {
for (pid = 3; pid < 20; pid++)
(void) close(pid);
(void) signal(SIGINT, SIG_DFL);
(void) signal(SIGQUIT, SIG_DFL);
close(pid);
signal(SIGINT, SIG_DFL);
signal(SIGQUIT, SIG_DFL);
shell = getenv("SHELL");
if (shell == NULL)
shell = _PATH_BSHELL;
namep = strrchr(shell,'/');
if (namep == NULL)
namep = shell;
(void) strcpy(shellnam,"-");
(void) strcat(shellnam, ++namep);
strcpy(shellnam,"-");
strcat(shellnam, ++namep);
if (strcmp(namep, "sh") != 0)
shellnam[0] = '+';
if (debug) {
printf ("%s\n", shell);
(void) fflush (stdout);
fflush (stdout);
}
if (argc > 1) {
execl(shell,shellnam,"-c",altarg,(char *)0);
@@ -1213,8 +1213,8 @@ shell(int argc, char **argv)
if (pid > 0)
while (wait(&status) != pid)
;
(void) signal(SIGINT, old1);
(void) signal(SIGQUIT, old2);
signal(SIGINT, old1);
signal(SIGQUIT, old2);
if (pid == -1) {
warn("%s", "Try again later");
code = -1;
@@ -1235,7 +1235,7 @@ user(int argc, char **argv)
char tmp[256];
if (argc < 2)
(void) another(&argc, &argv, "username");
another(&argc, &argv, "username");
if (argc < 2 || argc > 4) {
printf("usage: %s username [password] [account]\n", argv[0]);
code = -1;
@@ -1254,8 +1254,8 @@ user(int argc, char **argv)
}
if (n == CONTINUE) {
if (argc < 4) {
printf("Account: "); (void) fflush(stdout);
(void) fgets(acct, sizeof(acct) - 1, stdin);
printf("Account: "); fflush(stdout);
fgets(acct, sizeof(acct) - 1, stdin);
acct[strlen(acct) - 1] = '\0';
argv[3] = acct; argc++;
}
@@ -1267,7 +1267,7 @@ user(int argc, char **argv)
return;
}
if (!aflag && argc == 4) {
(void) command("ACCT %s", argv[3]);
command("ACCT %s", argv[3]);
}
}
@@ -1286,7 +1286,7 @@ pwd(int argc, char **argv)
verbose = 1;
if (command("PWD") == ERROR && code == 500) {
printf("PWD command not recognized, trying XPWD\n");
(void) command("XPWD");
command("XPWD");
}
verbose = oldverbose;
}
@@ -1306,7 +1306,7 @@ makedir(int argc, char **argv)
if (command("MKD %s", argv[1]) == ERROR && code == 500) {
if (verbose)
printf("MKD command not recognized, trying XMKD\n");
(void) command("XMKD %s", argv[1]);
command("XMKD %s", argv[1]);
}
}
@@ -1325,7 +1325,7 @@ removedir(int argc, char **argv)
if (command("RMD %s", argv[1]) == ERROR && code == 500) {
if (verbose)
printf("RMD command not recognized, trying XRMD\n");
(void) command("XRMD %s", argv[1]);
command("XRMD %s", argv[1]);
}
}
@@ -1371,7 +1371,7 @@ quote1(char *initial, int argc, char **argv)
int i, len;
char buf[BUFSIZ]; /* must be >= sizeof(line) */
(void) strcpy(buf, initial);
strcpy(buf, initial);
if (argc > 1) {
len = strlen(buf);
len += strlen(strcpy(&buf[len], argv[1]));
@@ -1398,7 +1398,7 @@ usage:
code = -1;
return;
}
(void) command("SITE CHMOD %s %s", argv[1], argv[2]);
command("SITE CHMOD %s %s", argv[1], argv[2]);
}
void
@@ -1407,7 +1407,7 @@ do_umask(int argc, char **argv)
int oldverbose = verbose;
verbose = 1;
(void) command(argc == 1 ? "SITE UMASK" : "SITE UMASK %s", argv[1]);
command(argc == 1 ? "SITE UMASK" : "SITE UMASK %s", argv[1]);
verbose = oldverbose;
}
@@ -1417,7 +1417,7 @@ ftp_idle(int argc, char **argv)
int oldverbose = verbose;
verbose = 1;
(void) command(argc == 1 ? "SITE IDLE" : "SITE IDLE %s", argv[1]);
command(argc == 1 ? "SITE IDLE" : "SITE IDLE %s", argv[1]);
verbose = oldverbose;
}
@@ -1430,7 +1430,7 @@ rmthelp(int argc, char **argv)
int oldverbose = verbose;
verbose = 1;
(void) command(argc == 1 ? "HELP" : "HELP %s", argv[1]);
command(argc == 1 ? "HELP" : "HELP %s", argv[1]);
verbose = oldverbose;
}
@@ -1460,9 +1460,9 @@ disconnect(int argc, char **argv)
if (!connected)
return;
(void) command("QUIT");
command("QUIT");
if (cout) {
(void) fclose(cout);
fclose(cout);
}
cout = NULL;
connected = 0;
@@ -1481,7 +1481,7 @@ confirm(char *cmd, char *file)
if (!interactive)
return (1);
printf("%s %s? ", cmd, file);
(void) fflush(stdout);
fflush(stdout);
if (fgets(line, sizeof line, stdin) == NULL)
return (0);
return (*line != 'n' && *line != 'N');
@@ -1530,18 +1530,18 @@ account(int argc, char **argv)
if (argc > 1) {
++argv;
--argc;
(void) strncpy(acct,*argv,49);
strncpy(acct,*argv,49);
acct[49] = '\0';
while (argc > 1) {
--argc;
++argv;
(void) strncat(acct,*argv, 49-strlen(acct));
strncat(acct,*argv, 49-strlen(acct));
}
}
else {
des_read_pw_string(acct, sizeof(acct), "Account:", 0);
}
(void) command("ACCT %s", acct);
command("ACCT %s", acct);
}
jmp_buf abortprox;
@@ -1577,19 +1577,19 @@ doproxy(int argc, char **argv)
c = getcmd(argv[1]);
if (c == (struct cmd *) -1) {
printf("?Ambiguous command\n");
(void) fflush(stdout);
fflush(stdout);
code = -1;
return;
}
if (c == 0) {
printf("?Invalid command\n");
(void) fflush(stdout);
fflush(stdout);
code = -1;
return;
}
if (!c->c_proxy) {
printf("?Invalid proxy command\n");
(void) fflush(stdout);
fflush(stdout);
code = -1;
return;
}
@@ -1601,9 +1601,9 @@ doproxy(int argc, char **argv)
pswitch(1);
if (c->c_conn && !connected) {
printf("Not connected\n");
(void) fflush(stdout);
fflush(stdout);
pswitch(0);
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
code = -1;
return;
}
@@ -1615,7 +1615,7 @@ doproxy(int argc, char **argv)
proxflag = 0;
}
pswitch(0);
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
}
void
@@ -1647,13 +1647,13 @@ setntrans(int argc, char **argv)
}
ntflag++;
code = ntflag;
(void) strncpy(ntin, argv[1], 16);
strncpy(ntin, argv[1], 16);
ntin[16] = '\0';
if (argc == 2) {
ntout[0] = '\0';
return;
}
(void) strncpy(ntout, argv[2], 16);
strncpy(ntout, argv[2], 16);
ntout[16] = '\0';
}
@@ -1711,10 +1711,10 @@ setnmap(int argc, char **argv)
cp = strchr(altarg, ' ');
}
*cp = '\0';
(void) strncpy(mapin, altarg, MaxPathLen - 1);
strncpy(mapin, altarg, MaxPathLen - 1);
while (*++cp == ' ')
continue;
(void) strncpy(mapout, cp, MaxPathLen - 1);
strncpy(mapout, cp, MaxPathLen - 1);
}
char *
@@ -1921,7 +1921,7 @@ cdup(int argc, char **argv)
if (command("CDUP") == ERROR && code == 500) {
if (verbose)
printf("CDUP command not recognized, trying XCUP\n");
(void) command("XCUP");
command("XCUP");
}
}
@@ -1944,7 +1944,7 @@ void
syst(int argc, char **argv)
{
(void) command("SYST");
command("SYST");
}
void
@@ -1966,7 +1966,7 @@ macdef(int argc, char **argv)
if (interactive) {
printf("Enter macro line by line, terminating it with a null line\n");
}
(void) strncpy(macros[macnum].mac_name, argv[1], 8);
strncpy(macros[macnum].mac_name, argv[1], 8);
if (macnum == 0) {
macros[macnum].mac_start = macbuf;
}
@@ -2018,7 +2018,7 @@ sizecmd(int argc, char **argv)
code = -1;
return;
}
(void) command("SIZE %s", argv[1]);
command("SIZE %s", argv[1]);
}
/*
@@ -2056,7 +2056,7 @@ void
rmtstatus(int argc, char **argv)
{
(void) command(argc > 1 ? "STAT %s" : "STAT" , argv[1]);
command(argc > 1 ? "STAT %s" : "STAT" , argv[1]);
}
/*

View File

@@ -56,7 +56,7 @@ domacro(int argc, char **argv)
code = -1;
return;
}
(void) strcpy(line2, line);
strcpy(line2, line);
TOP:
cp1 = macros[i].mac_start;
while (cp1 != macros[i].mac_end) {
@@ -77,7 +77,7 @@ TOP:
}
cp1--;
if (argc - 2 >= j) {
(void) strcpy(cp2, argv[j+1]);
strcpy(cp2, argv[j+1]);
cp2 += strlen(argv[j+1]);
}
break;
@@ -86,7 +86,7 @@ TOP:
loopflg = 1;
cp1++;
if (count < argc) {
(void) strcpy(cp2, argv[count]);
strcpy(cp2, argv[count]);
cp2 += strlen(argv[count]);
}
break;
@@ -121,9 +121,9 @@ TOP:
}
(*c->c_handler)(margc, margv);
if (bell && c->c_bell) {
(void) putchar('\007');
putchar('\007');
}
(void) strcpy(line, line2);
strcpy(line, line2);
makeargv();
argc = margc;
argv = margv;

View File

@@ -64,7 +64,7 @@ hookup(char *host, int port)
hisctladdr.sin_addr.s_addr = inet_addr(host);
if (hisctladdr.sin_addr.s_addr != INADDR_NONE) {
hisctladdr.sin_family = AF_INET;
(void) strncpy(hostnamebuf, host, sizeof(hostnamebuf));
strncpy(hostnamebuf, host, sizeof(hostnamebuf));
} else {
hp = gethostbyname(host);
if (hp == NULL) {
@@ -76,7 +76,7 @@ hookup(char *host, int port)
memmove((caddr_t)&hisctladdr.sin_addr,
hp->h_addr_list[0], hp->h_length);
memcpy(&hisctladdr.sin_addr, hp->h_addr, hp->h_length);
(void) strncpy(hostnamebuf, hp->h_name, sizeof(hostnamebuf));
strncpy(hostnamebuf, hp->h_name, sizeof(hostnamebuf));
}
hostname = hostnamebuf;
s = socket(hisctladdr.sin_family, SOCK_STREAM, 0);
@@ -99,7 +99,7 @@ hookup(char *host, int port)
hp->h_addr_list[0], hp->h_length);
fprintf(stdout, "Trying %s...\n",
inet_ntoa(hisctladdr.sin_addr));
(void) close(s);
close(s);
s = socket(hisctladdr.sin_family, SOCK_STREAM, 0);
if (s < 0) {
warn("socket");
@@ -128,9 +128,9 @@ hookup(char *host, int port)
if (cin == NULL || cout == NULL) {
warnx("fdopen failed.");
if (cin)
(void) fclose(cin);
fclose(cin);
if (cout)
(void) fclose(cout);
fclose(cout);
code = -1;
goto bad;
}
@@ -138,9 +138,9 @@ hookup(char *host, int port)
printf("Connected to %s.\n", hostname);
if (getreply(0) > 2) { /* read startup message from server */
if (cin)
(void) fclose(cin);
fclose(cin);
if (cout)
(void) fclose(cout);
fclose(cout);
code = -1;
goto bad;
}
@@ -157,7 +157,7 @@ hookup(char *host, int port)
return (hostname);
bad:
(void) close(s);
close(s);
return ((char *)0);
}
@@ -232,12 +232,12 @@ login(char *host)
return (0);
}
if (!aflag && acct != NULL)
(void) command("ACCT %s", acct);
command("ACCT %s", acct);
if (proxy)
return (1);
for (n = 0; n < macnum; ++n) {
if (!strcmp("init", macros[n].mac_name)) {
(void) strcpy(line, "$init");
strcpy(line, "$init");
makeargv();
domacro(margc, margv);
break;
@@ -252,7 +252,7 @@ cmdabort(int sig)
{
printf("\n");
(void) fflush(stdout);
fflush(stdout);
abrtflag++;
if (ptflag)
longjmp(ptabort,1);
@@ -287,15 +287,15 @@ command(char *fmt, ...)
va_end(ap);
if(debug){
printf("\n");
(void) fflush(stdout);
fflush(stdout);
}
fprintf(cout, "\r\n");
(void) fflush(cout);
fflush(cout);
cpend = 1;
r = getreply(!strcmp(fmt, "QUIT"));
if (abrtflag && oldintr != SIG_IGN)
(*oldintr)(SIGINT);
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
return (r);
}
@@ -415,13 +415,13 @@ getreply(int expecteof)
case WONT:
c = getc(cin);
fprintf(cout, "%c%c%c", IAC, DONT, c);
(void) fflush(cout);
fflush(cout);
break;
case DO:
case DONT:
c = getc(cin);
fprintf(cout, "%c%c%c", IAC, WONT, c);
(void) fflush(cout);
fflush(cout);
break;
default:
break;
@@ -431,14 +431,14 @@ getreply(int expecteof)
dig++;
if (c == EOF) {
if (expecteof) {
(void) signal(SIGINT,oldintr);
signal(SIGINT,oldintr);
code = 221;
return (0);
}
lostpeer(0);
if (verbose) {
printf("421 Service not available, remote server has closed connection\n");
(void) fflush(stdout);
fflush(stdout);
}
code = 421;
return (4);
@@ -448,7 +448,7 @@ getreply(int expecteof)
if (proxflag &&
(dig == 1 || dig == 5 && verbose == 0))
printf("%s:",hostname);
(void) putchar(c);
putchar(c);
}
if (dig < 4 && isdigit(c))
code = code * 10 + (c - '0');
@@ -475,8 +475,8 @@ getreply(int expecteof)
*cp++ = c;
}
if (verbose > 0 || verbose > -1 && n == '5') {
(void) putchar(c);
(void) fflush (stdout);
putchar(c);
fflush (stdout);
}
if (continuation && code != originalcode) {
if (originalcode == 0)
@@ -496,7 +496,7 @@ getreply(int expecteof)
if (n != '1')
cpend = 0;
(void) signal(SIGINT,oldintr);
signal(SIGINT,oldintr);
if (code == 421 || originalcode == 421)
lostpeer(0);
if (abrtflag && oldintr != cmdabort && oldintr != SIG_IGN)
@@ -525,7 +525,7 @@ abortsend(int sig)
mflag = 0;
abrtflag = 0;
printf("\nsend aborted\nwaiting for remote to finish abort\n");
(void) fflush(stdout);
fflush(stdout);
longjmp(sendabort, 1);
}
@@ -615,16 +615,16 @@ sendrequest(char *cmd, char *local, char *remote, int printnames)
lmode = "w";
if (setjmp(sendabort)) {
while (cpend) {
(void) getreply(0);
getreply(0);
}
if (data >= 0) {
(void) close(data);
close(data);
data = -1;
}
if (oldintr)
(void) signal(SIGINT,oldintr);
signal(SIGINT,oldintr);
if (oldintp)
(void) signal(SIGPIPE,oldintp);
signal(SIGPIPE,oldintp);
code = -1;
return;
}
@@ -636,8 +636,8 @@ sendrequest(char *cmd, char *local, char *remote, int printnames)
fin = popen(local + 1, "r");
if (fin == NULL) {
warn("%s", local + 1);
(void) signal(SIGINT, oldintr);
(void) signal(SIGPIPE, oldintp);
signal(SIGINT, oldintr);
signal(SIGPIPE, oldintp);
code = -1;
return;
}
@@ -646,7 +646,7 @@ sendrequest(char *cmd, char *local, char *remote, int printnames)
fin = fopen(local, "r");
if (fin == NULL) {
warn("local: %s", local);
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
code = -1;
return;
}
@@ -654,16 +654,16 @@ sendrequest(char *cmd, char *local, char *remote, int printnames)
if (fstat(fileno(fin), &st) < 0 ||
(st.st_mode&S_IFMT) != S_IFREG) {
fprintf(stdout, "%s: not a plain file.\n", local);
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
fclose(fin);
code = -1;
return;
}
}
if (initconn()) {
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
if (oldintp)
(void) signal(SIGPIPE, oldintp);
signal(SIGPIPE, oldintp);
code = -1;
if (closefunc != NULL)
(*closefunc)(fin);
@@ -704,18 +704,18 @@ sendrequest(char *cmd, char *local, char *remote, int printnames)
}
if (remote) {
if (command("%s %s", cmd, remote) != PRELIM) {
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
if (oldintp)
(void) signal(SIGPIPE, oldintp);
signal(SIGPIPE, oldintp);
if (closefunc != NULL)
(*closefunc)(fin);
return;
}
} else
if (command("%s", cmd) != PRELIM) {
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
if (oldintp)
(void) signal(SIGPIPE, oldintp);
signal(SIGPIPE, oldintp);
if (closefunc != NULL)
(*closefunc)(fin);
return;
@@ -738,13 +738,13 @@ sendrequest(char *cmd, char *local, char *remote, int printnames)
while ((c = getc(fin)) != EOF) {
if (c == '\n') {
while (hash && (bytes >= hashbytes)) {
(void) putchar('#');
(void) fflush(stdout);
putchar('#');
fflush(stdout);
hashbytes += HASHBYTES;
}
if (ferror(dout))
break;
(void) sec_putc('\r', dout);
sec_putc('\r', dout);
bytes++;
}
sec_putc(c, dout);
@@ -753,9 +753,9 @@ sendrequest(char *cmd, char *local, char *remote, int printnames)
sec_fflush(dout);
if (hash) {
if (bytes < hashbytes)
(void) putchar('#');
(void) putchar('\n');
(void) fflush(stdout);
putchar('#');
putchar('\n');
fflush(stdout);
}
if (ferror(fin))
warn("local: %s", local);
@@ -768,34 +768,34 @@ sendrequest(char *cmd, char *local, char *remote, int printnames)
}
if (closefunc != NULL)
(*closefunc)(fin);
(void) fclose(dout);
(void) gettimeofday(&stop, (struct timezone *)0);
(void) getreply(0);
(void) signal(SIGINT, oldintr);
fclose(dout);
gettimeofday(&stop, (struct timezone *)0);
getreply(0);
signal(SIGINT, oldintr);
if (oldintp)
(void) signal(SIGPIPE, oldintp);
signal(SIGPIPE, oldintp);
if (bytes > 0)
ptransfer("sent", bytes, &start, &stop);
return;
abort:
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
if (oldintp)
(void) signal(SIGPIPE, oldintp);
signal(SIGPIPE, oldintp);
if (!cpend) {
code = -1;
return;
}
if (data >= 0) {
(void) close(data);
close(data);
data = -1;
}
if (dout)
(void) fclose(dout);
(void) getreply(0);
fclose(dout);
getreply(0);
code = -1;
if (closefunc != NULL && fin != NULL)
(*closefunc)(fin);
(void) gettimeofday(&stop, (struct timezone *)0);
gettimeofday(&stop, (struct timezone *)0);
if (bytes > 0)
ptransfer("sent", bytes, &start, &stop);
}
@@ -809,7 +809,7 @@ abortrecv(int sig)
mflag = 0;
abrtflag = 0;
printf("\nreceive aborted\nwaiting for remote to finish abort\n");
(void) fflush(stdout);
fflush(stdout);
longjmp(recvabort, 1);
}
@@ -843,14 +843,14 @@ recvrequest(char *cmd, char *local, char *remote, char *lmode, int printnames)
tcrflag = !crflag && is_retr;
if (setjmp(recvabort)) {
while (cpend) {
(void) getreply(0);
getreply(0);
}
if (data >= 0) {
(void) close(data);
close(data);
data = -1;
}
if (oldintr)
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
code = -1;
return;
}
@@ -861,7 +861,7 @@ recvrequest(char *cmd, char *local, char *remote, char *lmode, int printnames)
if (errno != ENOENT && errno != EACCES) {
warn("local: %s", local);
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
code = -1;
return;
}
@@ -872,27 +872,27 @@ recvrequest(char *cmd, char *local, char *remote, char *lmode, int printnames)
*dir = '/';
if (d < 0) {
warn("local: %s", local);
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
code = -1;
return;
}
if (!runique && errno == EACCES &&
chmod(local, 0600) < 0) {
warn("local: %s", local);
(void) signal(SIGINT, oldintr);
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
code = -1;
return;
}
if (runique && errno == EACCES &&
(local = gunique(local)) == NULL) {
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
code = -1;
return;
}
}
else if (runique && (local = gunique(local)) == NULL) {
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
code = -1;
return;
}
@@ -903,7 +903,7 @@ recvrequest(char *cmd, char *local, char *remote, char *lmode, int printnames)
} else if (curtype != type)
changetype(type, 0);
if (initconn()) {
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
code = -1;
return;
}
@@ -914,12 +914,12 @@ recvrequest(char *cmd, char *local, char *remote, char *lmode, int printnames)
return;
if (remote) {
if (command("%s %s", cmd, remote) != PRELIM) {
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
return;
}
} else {
if (command("%s", cmd) != PRELIM) {
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
return;
}
}
@@ -953,7 +953,7 @@ recvrequest(char *cmd, char *local, char *remote, char *lmode, int printnames)
#endif
if (blocksize > bufsize) {
if (buf)
(void) free(buf);
free(buf);
buf = malloc(blocksize);
if (buf == NULL) {
warn("malloc");
@@ -963,7 +963,7 @@ recvrequest(char *cmd, char *local, char *remote, char *lmode, int printnames)
bufsize = blocksize;
}
}
(void) gettimeofday(&start, (struct timezone *)0);
gettimeofday(&start, (struct timezone *)0);
switch (curtype) {
case TYPE_I:
@@ -982,17 +982,17 @@ recvrequest(char *cmd, char *local, char *remote, char *lmode, int printnames)
bytes += c;
if (hash) {
while (bytes >= hashbytes) {
(void) putchar('#');
putchar('#');
hashbytes += HASHBYTES;
}
(void) fflush(stdout);
fflush(stdout);
}
}
if (hash && bytes > 0) {
if (bytes < HASHBYTES)
(void) putchar('#');
(void) putchar('\n');
(void) fflush(stdout);
putchar('#');
putchar('\n');
fflush(stdout);
}
if (c < 0) {
if (errno != EPIPE)
@@ -1034,15 +1034,15 @@ done:
bare_lfs++;
while (c == '\r') {
while (hash && (bytes >= hashbytes)) {
(void) putchar('#');
(void) fflush(stdout);
putchar('#');
fflush(stdout);
hashbytes += HASHBYTES;
}
bytes++;
if ((c = sec_getc(din)) != '\n' || tcrflag) {
if (ferror(fout))
goto break2;
(void) putc('\r', fout);
putc('\r', fout);
if (c == '\0') {
bytes++;
goto contin2;
@@ -1051,7 +1051,7 @@ done:
goto contin2;
}
}
(void) putc(c, fout);
putc(c, fout);
bytes++;
contin2: ;
}
@@ -1062,9 +1062,9 @@ break2:
}
if (hash) {
if (bytes < hashbytes)
(void) putchar('#');
(void) putchar('\n');
(void) fflush(stdout);
putchar('#');
putchar('\n');
fflush(stdout);
}
if (ferror(din)) {
if (errno != EPIPE)
@@ -1077,12 +1077,12 @@ break2:
}
if (closefunc != NULL)
(*closefunc)(fout);
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
if (oldintp)
(void) signal(SIGPIPE, oldintp);
(void) fclose(din);
(void) gettimeofday(&stop, (struct timezone *)0);
(void) getreply(0);
signal(SIGPIPE, oldintp);
fclose(din);
gettimeofday(&stop, (struct timezone *)0);
getreply(0);
if (bytes > 0 && is_retr)
ptransfer("received", bytes, &start, &stop);
return;
@@ -1091,28 +1091,28 @@ abort:
/* abort using RFC959 recommended IP,SYNC sequence */
if (oldintp)
(void) signal(SIGPIPE, oldintr);
(void) signal(SIGINT, SIG_IGN);
signal(SIGPIPE, oldintr);
signal(SIGINT, SIG_IGN);
if (!cpend) {
code = -1;
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
return;
}
abort_remote(din);
code = -1;
if (data >= 0) {
(void) close(data);
close(data);
data = -1;
}
if (closefunc != NULL && fout != NULL)
(*closefunc)(fout);
if (din)
(void) fclose(din);
(void) gettimeofday(&stop, (struct timezone *)0);
fclose(din);
gettimeofday(&stop, (struct timezone *)0);
if (bytes > 0)
ptransfer("received", bytes, &start, &stop);
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
}
/*
@@ -1192,7 +1192,7 @@ noport:
if (sendport)
data_addr.sin_port = 0; /* let system pick one */
if (data != -1)
(void) close(data);
close(data);
data = socket(AF_INET, SOCK_STREAM, 0);
if (data < 0) {
warn("socket");
@@ -1245,7 +1245,7 @@ noport:
#endif
return (0);
bad:
(void) close(data), data = -1;
close(data), data = -1;
if (tmpno)
sendport = 1;
return (1);
@@ -1263,10 +1263,10 @@ dataconn(char *lmode)
s = accept(data, (struct sockaddr *) &from, &fromlen);
if (s < 0) {
warn("accept");
(void) close(data), data = -1;
close(data), data = -1;
return (NULL);
}
(void) close(data);
close(data);
data = s;
#ifdef IP_TOS
tos = IPTOS_THROUGHPUT;
@@ -1364,7 +1364,7 @@ pswitch(int flag)
ip->connect = connected;
connected = op->connect;
if (hostname) {
(void) strncpy(ip->name, hostname, sizeof(ip->name) - 1);
strncpy(ip->name, hostname, sizeof(ip->name) - 1);
ip->name[strlen(ip->name)] = '\0';
} else
ip->name[0] = 0;
@@ -1391,21 +1391,21 @@ pswitch(int flag)
mcase = op->mcse;
ip->ntflg = ntflag;
ntflag = op->ntflg;
(void) strncpy(ip->nti, ntin, 16);
strncpy(ip->nti, ntin, 16);
(ip->nti)[strlen(ip->nti)] = '\0';
(void) strcpy(ntin, op->nti);
(void) strncpy(ip->nto, ntout, 16);
strcpy(ntin, op->nti);
strncpy(ip->nto, ntout, 16);
(ip->nto)[strlen(ip->nto)] = '\0';
(void) strcpy(ntout, op->nto);
strcpy(ntout, op->nto);
ip->mapflg = mapflag;
mapflag = op->mapflg;
(void) strncpy(ip->mi, mapin, MaxPathLen - 1);
strncpy(ip->mi, mapin, MaxPathLen - 1);
(ip->mi)[strlen(ip->mi)] = '\0';
(void) strcpy(mapin, op->mi);
(void) strncpy(ip->mo, mapout, MaxPathLen - 1);
strcpy(mapin, op->mi);
strncpy(ip->mo, mapout, MaxPathLen - 1);
(ip->mo)[strlen(ip->mo)] = '\0';
(void) strcpy(mapout, op->mo);
(void) signal(SIGINT, oldintr);
strcpy(mapout, op->mo);
signal(SIGINT, oldintr);
if (abrtflag) {
abrtflag = 0;
(*oldintr)(SIGINT);
@@ -1417,7 +1417,7 @@ abortpt(int sig)
{
printf("\n");
(void) fflush(stdout);
fflush(stdout);
ptabflg++;
mflag = 0;
abrtflag = 0;
@@ -1465,7 +1465,7 @@ proxtrans(char *cmd, char *local, char *remote)
goto abort;
oldintr = signal(SIGINT, abortpt);
if (command("%s %s", cmd, remote) != PRELIM) {
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
pswitch(1);
return;
}
@@ -1475,16 +1475,16 @@ proxtrans(char *cmd, char *local, char *remote)
if (command("%s %s", cmd2, local) != PRELIM)
goto abort;
ptflag++;
(void) getreply(0);
getreply(0);
pswitch(0);
(void) getreply(0);
(void) signal(SIGINT, oldintr);
getreply(0);
signal(SIGINT, oldintr);
pswitch(1);
ptflag = 0;
printf("local: %s remote: %s\n", local, remote);
return;
abort:
(void) signal(SIGINT, SIG_IGN);
signal(SIGINT, SIG_IGN);
ptflag = 0;
if (strcmp(cmd, "RETR") && !proxy)
pswitch(1);
@@ -1499,7 +1499,7 @@ abort:
pswitch(1);
if (ptabflg)
code = -1;
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
return;
}
if (cpend)
@@ -1513,7 +1513,7 @@ abort:
pswitch(1);
if (ptabflg)
code = -1;
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
return;
}
}
@@ -1531,15 +1531,15 @@ abort:
code = -1;
lostpeer(0);
}
(void) getreply(0);
(void) getreply(0);
getreply(0);
getreply(0);
}
if (proxy)
pswitch(0);
pswitch(1);
if (ptabflg)
code = -1;
(void) signal(SIGINT, oldintr);
signal(SIGINT, oldintr);
}
void
@@ -1557,7 +1557,7 @@ reset(int argc, char **argv)
lostpeer(0);
}
else if (nfnd) {
(void) getreply(0);
getreply(0);
}
}
}
@@ -1579,7 +1579,7 @@ gunique(char *local)
warn("local: %s", local);
return ((char *) 0);
}
(void) strcpy(new, local);
strcpy(new, local);
cp = new + strlen(new);
*cp++ = '.';
while (!d) {
@@ -1622,7 +1622,7 @@ abort_remote(FILE *din)
if (send(fileno(cout), buf, 3, MSG_OOB) != 3)
warn("abort");
fprintf(cout,"%cABOR\r\n", DM);
(void) fflush(cout);
fflush(cout);
FD_ZERO(&mask);
FD_SET(fileno(cin), &mask);
if (din) {
@@ -1642,7 +1642,7 @@ abort_remote(FILE *din)
}
if (getreply(0) == ERROR && code == 552) {
/* 552 needed for nic style abort */
(void) getreply(0);
getreply(0);
}
(void) getreply(0);
getreply(0);
}

View File

@@ -81,7 +81,7 @@ main(int argc, char **argv)
break;
default:
(void)fprintf(stderr,
fprintf(stderr,
"usage: ftp [-dgintv] [host [port]]\n");
exit(1);
}
@@ -103,15 +103,15 @@ main(int argc, char **argv)
pw = getpwuid(getuid());
if (pw != NULL) {
home = homedir;
(void) strcpy(home, pw->pw_dir);
strcpy(home, pw->pw_dir);
}
if (argc > 0) {
char *xargv[5];
if (setjmp(toplevel))
exit(0);
(void) signal(SIGINT, intr);
(void) signal(SIGPIPE, lostpeer);
signal(SIGINT, intr);
signal(SIGPIPE, lostpeer);
xargv[0] = argv[0]; /* or should this be "ftp"? */
xargv[1] = argv[0];
xargv[2] = argv[1];
@@ -121,8 +121,8 @@ main(int argc, char **argv)
}
if (setjmp(toplevel) == 0) {
top = 1;
(void) signal(SIGINT, intr);
(void) signal(SIGPIPE, lostpeer);
signal(SIGINT, intr);
signal(SIGPIPE, lostpeer);
} else
top = 0;
for (;;) {
@@ -144,13 +144,13 @@ lostpeer(int sig)
if (connected) {
if (cout != NULL) {
(void) shutdown(fileno(cout), 1+1);
(void) fclose(cout);
shutdown(fileno(cout), 1+1);
fclose(cout);
cout = NULL;
}
if (data >= 0) {
(void) shutdown(data, 1+1);
(void) close(data);
shutdown(data, 1+1);
close(data);
data = -1;
}
connected = 0;
@@ -158,8 +158,8 @@ lostpeer(int sig)
pswitch(1);
if (connected) {
if (cout != NULL) {
(void) shutdown(fileno(cout), 1+1);
(void) fclose(cout);
shutdown(fileno(cout), 1+1);
fclose(cout);
cout = NULL;
}
connected = 0;
@@ -198,11 +198,11 @@ cmdscanner(int top)
int l;
if (!top)
(void) putchar('\n');
putchar('\n');
for (;;) {
if (fromatty) {
printf("ftp> ");
(void) fflush(stdout);
fflush(stdout);
}
if (fgets(line, sizeof line, stdin) == NULL)
quit(0, 0);
@@ -238,12 +238,12 @@ cmdscanner(int top)
}
(*c->c_handler)(margc, margv);
if (bell && c->c_bell)
(void) putchar('\007');
putchar('\007');
if (c->c_handler != help)
break;
}
(void) signal(SIGINT, intr);
(void) signal(SIGPIPE, lostpeer);
signal(SIGINT, intr);
signal(SIGPIPE, lostpeer);
}
struct cmd *
@@ -466,7 +466,7 @@ help(int argc, char **argv)
}
else if (c->c_name) {
for (k=0; k < strlen(c->c_name); k++) {
(void) putchar(' ');
putchar(' ');
}
}
if (c + lines >= &cmdtab[NCMDS]) {
@@ -476,7 +476,7 @@ help(int argc, char **argv)
w = strlen(c->c_name);
while (w < width) {
w = (w + 8) &~ 7;
(void) putchar('\t');
putchar('\t');
}
}
}

View File

@@ -79,7 +79,7 @@ ruserpass(char *host, char **aname, char **apass, char **aacct)
hdir = getenv("HOME");
if (hdir == NULL)
hdir = ".";
(void) sprintf(buf, "%s/.netrc", hdir);
sprintf(buf, "%s/.netrc", hdir);
cfile = fopen(buf, "r");
if (cfile == NULL) {
if (errno != ENOENT)
@@ -128,7 +128,7 @@ next:
if (token())
if (*aname == 0) {
*aname = malloc((unsigned) strlen(tokval) + 1);
(void) strcpy(*aname, tokval);
strcpy(*aname, tokval);
} else {
if (strcmp(*aname, tokval))
goto next;
@@ -144,7 +144,7 @@ next:
}
if (token() && *apass == 0) {
*apass = malloc((unsigned) strlen(tokval) + 1);
(void) strcpy(*apass, tokval);
strcpy(*apass, tokval);
}
break;
case ACCOUNT:
@@ -156,12 +156,12 @@ next:
}
if (token() && *aacct == 0) {
*aacct = malloc((unsigned) strlen(tokval) + 1);
(void) strcpy(*aacct, tokval);
strcpy(*aacct, tokval);
}
break;
case MACDEF:
if (proxy) {
(void) fclose(cfile);
fclose(cfile);
return (0);
}
while ((c=getc(cfile)) != EOF && c == ' ' || c == '\t');
@@ -230,10 +230,10 @@ next:
goto done;
}
done:
(void) fclose(cfile);
fclose(cfile);
return (0);
bad:
(void) fclose(cfile);
fclose(cfile);
return (-1);
}

View File

@@ -239,7 +239,7 @@ cmd
{
usedefault = 0;
if (pdata >= 0) {
(void) close(pdata);
close(pdata);
pdata = -1;
}
reply(200, "PORT command successful.");
@@ -492,7 +492,7 @@ cmd
if ($4) {
oldmask = umask(0);
(void) umask(oldmask);
umask(oldmask);
reply(200, "Current UMASK is %03o", oldmask);
}
}
@@ -539,7 +539,7 @@ cmd
maxtimeout);
} else {
ftpd_timeout = $5;
(void) alarm((unsigned) ftpd_timeout);
alarm((unsigned) ftpd_timeout);
reply(200,
"Maximum IDLE time set to %d seconds",
ftpd_timeout);
@@ -1009,13 +1009,13 @@ getline(char *s, int n)
case WONT:
c = getc(stdin);
printf("%c%c%c", IAC, DONT, 0377&c);
(void) fflush(stdout);
fflush(stdout);
continue;
case DO:
case DONT:
c = getc(stdin);
printf("%c%c%c", IAC, WONT, 0377&c);
(void) fflush(stdout);
fflush(stdout);
continue;
case IAC:
break;
@@ -1082,13 +1082,13 @@ yylex(void)
switch (state) {
case CMD:
(void) signal(SIGALRM, toolong);
(void) alarm((unsigned) ftpd_timeout);
signal(SIGALRM, toolong);
alarm((unsigned) ftpd_timeout);
if (getline(cbuf, sizeof(cbuf)-1) == NULL) {
reply(221, "You could at least say goodbye.");
dologout(0);
}
(void) alarm(0);
alarm(0);
#ifdef HASSETPROCTITLE
if (strncasecmp(cbuf, "PASS", 4) != NULL)
setproctitle("%s: %s", proctitle, cbuf);
@@ -1305,7 +1305,7 @@ copy(char *s)
p = malloc((unsigned) strlen(s) + 1);
if (p == NULL)
fatal("Ran out of memory.");
(void) strcpy(p, s);
strcpy(p, s);
return (p);
}
@@ -1396,7 +1396,7 @@ sizecmd(char *filename)
}
if (fstat(fileno(fin), &stbuf) < 0 || !S_ISREG(stbuf.st_mode)) {
reply(550, "%s: not a plain file.", filename);
(void) fclose(fin);
fclose(fin);
return;
}
@@ -1406,7 +1406,7 @@ sizecmd(char *filename)
count++;
count++;
}
(void) fclose(fin);
fclose(fin);
reply(213, "%ld", count);
break; }

View File

@@ -391,7 +391,7 @@ main(int argc, char **argv)
sprintf(ttyline, "ftp%u", (unsigned)getpid());
/* (void) freopen(_PATH_DEVNULL, "w", stderr); */
/* freopen(_PATH_DEVNULL, "w", stderr); */
signal(SIGPIPE, lostconn);
signal(SIGCHLD, SIG_IGN);
if (signal(SIGURG, myoob) == SIG_ERR)
@@ -428,8 +428,8 @@ main(int argc, char **argv)
*cp = '\0';
lreply(530, "%s", line);
}
(void) fflush(stdout);
(void) fclose(fd);
fflush(stdout);
fclose(fd);
reply(530, "System not available.");
exit(0);
}
@@ -439,8 +439,8 @@ main(int argc, char **argv)
*cp = '\0';
lreply(220, "%s", line);
}
(void) fflush(stdout);
(void) fclose(fd);
fflush(stdout);
fclose(fd);
/* reply(220,) must follow */
}
k_gethostname(hostname, sizeof(hostname));
@@ -474,7 +474,7 @@ sgetsave(char *s)
dologout(1);
/* NOTREACHED */
}
(void) strcpy(new, s);
strcpy(new, s);
return (new);
}
@@ -638,7 +638,7 @@ checkuser(char *fname, char *name)
break;
}
}
(void) fclose(fd);
fclose(fd);
}
return (found);
}
@@ -651,7 +651,7 @@ int do_login(int code, char *passwd)
reply(550, "Can't set gid.");
return -1;
}
(void) initgroups(pw->pw_name, pw->pw_gid);
initgroups(pw->pw_name, pw->pw_gid);
/* open wtmp before chroot */
logwtmp(ttyline, pw->pw_name, remotehost);
@@ -719,7 +719,7 @@ int do_login(int code, char *passwd)
syslog(LOG_INFO, "FTP LOGIN FROM %s as %s",
remotehost, pw->pw_name);
}
(void) umask(defumask);
umask(defumask);
return 0;
}
@@ -732,7 +732,7 @@ static void
end_login(void)
{
(void) seteuid((uid_t)0);
seteuid((uid_t)0);
if (logged_in)
logwtmp(ttyline, "", "");
pw = NULL;
@@ -924,7 +924,7 @@ retrieve(char *cmd, char *name)
#else
send_data(fin, dout, BUFSIZ);
#endif
(void) fclose(dout);
fclose(dout);
data = -1;
pdata = -1;
done:
@@ -1027,7 +1027,7 @@ store(char *name, char *mode, int unique)
else
reply(226, "Transfer complete.");
}
(void) fclose(din);
fclose(din);
data = -1;
pdata = -1;
done:
@@ -1042,7 +1042,7 @@ getdatasock(char *mode)
if (data >= 0)
return (fdopen(data, mode));
(void) seteuid((uid_t)0);
seteuid((uid_t)0);
s = socket(AF_INET, SOCK_STREAM, 0);
if (s < 0)
goto bad;
@@ -1060,7 +1060,7 @@ getdatasock(char *mode)
goto bad;
sleep(tries);
}
(void) seteuid((uid_t)pw->pw_uid);
seteuid((uid_t)pw->pw_uid);
#ifdef IP_TOS
on = IPTOS_THROUGHPUT;
if (setsockopt(s, IPPROTO_IP, IP_TOS, (void *)&on, sizeof(int)) < 0)
@@ -1070,8 +1070,8 @@ getdatasock(char *mode)
bad:
/* Return the real value of errno (close may change it) */
t = errno;
(void) seteuid((uid_t)pw->pw_uid);
(void) close(s);
seteuid((uid_t)pw->pw_uid);
close(s);
errno = t;
return (NULL);
}
@@ -1086,9 +1086,9 @@ dataconn(char *name, off_t size, char *mode)
file_size = size;
byte_count = 0;
if (size != (off_t) -1)
(void) sprintf(sizebuf, " (%ld bytes)", size);
sprintf(sizebuf, " (%ld bytes)", size);
else
(void) strcpy(sizebuf, "");
strcpy(sizebuf, "");
if (pdata >= 0) {
struct sockaddr_in from;
int s, fromlen = sizeof(from);
@@ -1096,15 +1096,15 @@ dataconn(char *name, off_t size, char *mode)
s = accept(pdata, (struct sockaddr *)&from, &fromlen);
if (s < 0) {
reply(425, "Can't open data connection.");
(void) close(pdata);
close(pdata);
pdata = -1;
return (NULL);
}
(void) close(pdata);
close(pdata);
pdata = s;
#ifdef IP_TOS
tos = IPTOS_THROUGHPUT;
(void) setsockopt(s, IPPROTO_IP, IP_TOS, (void *)&tos,
setsockopt(s, IPPROTO_IP, IP_TOS, (void *)&tos,
sizeof(int));
#endif
reply(150, "Opening %s mode data connection for '%s'%s.",
@@ -1136,7 +1136,7 @@ dataconn(char *name, off_t size, char *mode)
continue;
}
perror_reply(425, "Can't build data connection");
(void) fclose(file);
fclose(file);
data = -1;
return (NULL);
}
@@ -1356,20 +1356,20 @@ statfilecmd(char *filename)
if (c == '\n') {
if (ferror(stdout)){
perror_reply(421, "control connection");
(void) ftpd_pclose(fin);
ftpd_pclose(fin);
dologout(1);
/* NOTREACHED */
}
if (ferror(fin)) {
perror_reply(551, filename);
(void) ftpd_pclose(fin);
ftpd_pclose(fin);
return;
}
(void) putc('\r', stdout);
putc('\r', stdout);
}
(void) putc(c, stdout);
putc(c, stdout);
}
(void) ftpd_pclose(fin);
ftpd_pclose(fin);
reply(211, "End of Status");
}
@@ -1623,9 +1623,9 @@ dolog(struct sockaddr_in *sin)
sizeof(struct in_addr), AF_INET);
if (hp)
(void) strncpy(remotehost, hp->h_name, sizeof(remotehost));
strncpy(remotehost, hp->h_name, sizeof(remotehost));
else
(void) strncpy(remotehost, inet_ntoa(sin->sin_addr),
strncpy(remotehost, inet_ntoa(sin->sin_addr),
sizeof(remotehost));
#endif
inaddr2str (sin->sin_addr, remotehost, sizeof(remotehost));
@@ -1647,7 +1647,7 @@ dologout(int status)
{
if (logged_in) {
(void) seteuid((uid_t)0);
seteuid((uid_t)0);
logwtmp(ttyline, "", "");
dest_tkt();
if(k_hasafs())
@@ -1725,12 +1725,12 @@ passive(void)
}
pasv_addr = ctrl_addr;
pasv_addr.sin_port = 0;
(void) seteuid((uid_t)0);
seteuid((uid_t)0);
if (bind(pdata, (struct sockaddr *)&pasv_addr, sizeof(pasv_addr)) < 0) {
(void) seteuid((uid_t)pw->pw_uid);
seteuid((uid_t)pw->pw_uid);
goto pasv_error;
}
(void) seteuid((uid_t)pw->pw_uid);
seteuid((uid_t)pw->pw_uid);
len = sizeof(pasv_addr);
if (getsockname(pdata, (struct sockaddr *) &pasv_addr, &len) < 0)
goto pasv_error;
@@ -1746,7 +1746,7 @@ passive(void)
return;
pasv_error:
(void) close(pdata);
close(pdata);
pdata = -1;
perror_reply(425, "Can't open passive connection");
return;
@@ -1774,11 +1774,11 @@ gunique(char *local)
}
if (cp)
*cp = '/';
(void) strcpy(new, local);
strcpy(new, local);
cp = new + strlen(new);
*cp++ = '.';
for (count = 1; count < 100; count++) {
(void)sprintf(cp, "%d", count);
sprintf(cp, "%d", count);
if (stat(new, &st) < 0)
return (new);
}
@@ -1851,7 +1851,7 @@ send_file_list(char *whichf)
}
perror_reply(550, whichf);
if (dout != NULL) {
(void) fclose(dout);
fclose(dout);
transflag = 0;
data = -1;
pdata = -1;
@@ -1909,7 +1909,7 @@ send_file_list(char *whichf)
byte_count += strlen(nbuf) + 1;
}
}
(void) closedir(dirp);
closedir(dirp);
}
if (dout == NULL)
reply(550, "No files found.");
@@ -1922,7 +1922,7 @@ send_file_list(char *whichf)
if (dout != NULL){
auth_write(fileno(dout), buf, 0); /* XXX flush */
(void) fclose(dout);
fclose(dout);
}
data = -1;
pdata = -1;

View File

@@ -101,5 +101,5 @@ stty_default(void)
termios.c_cc[VSUSP] = Ctl('Z');
(void)tcsetattr(0, TCSANOW, &termios);
tcsetattr(0, TCSANOW, &termios);
}

View File

@@ -26,7 +26,7 @@ pop_dropcopy(POP *p, struct passwd *pwp)
int nchar; /* Bytes written/read */
/* Create a temporary maildrop into which to copy the updated maildrop */
(void)sprintf(p->temp_drop,POP_DROP,p->user);
sprintf(p->temp_drop,POP_DROP,p->user);
#ifdef DEBUG
if(p->debug)
@@ -41,7 +41,7 @@ pop_dropcopy(POP *p, struct passwd *pwp)
/* First create a unique file. Would prefer mkstemp, but Ultrix...*/
strcpy(template,POP_TMPDROP);
(void) mktemp(template);
mktemp(template);
if ( (tf=fopen(template,"w+")) == NULL ) { /* failure, bail out */
pop_log(p,POP_PRIORITY,
"Unable to create temporary temporary maildrop '%s': %s",template,
@@ -52,23 +52,23 @@ pop_dropcopy(POP *p, struct passwd *pwp)
/* Now give this file to the user */
if (pwp) {
(void) chown(template,pwp->pw_uid, pwp->pw_gid);
chown(template,pwp->pw_uid, pwp->pw_gid);
}
(void) chmod(template,0600);
chmod(template,0600);
/* Now link this file to the temporary maildrop. If this fails it
* is probably because the temporary maildrop already exists. If so,
* this is ok. We can just go on our way, because by the time we try
* to write into the file we will be running as the user.
*/
(void) link(template,p->temp_drop);
(void) fclose(tf);
(void) unlink(template);
link(template,p->temp_drop);
fclose(tf);
unlink(template);
/* Now we run as the user. */
if (pwp) {
(void) setuid(pwp->pw_uid);
(void) setgid(pwp->pw_gid);
setuid(pwp->pw_uid);
setgid(pwp->pw_gid);
}
#ifdef DEBUG
if(p->debug)pop_log(p,POP_DEBUG,"uid = %d, gid = %d",getuid(),getgid());
@@ -104,7 +104,7 @@ pop_dropcopy(POP *p, struct passwd *pwp)
/* Lock the maildrop */
if (k_flock (mfd, K_LOCK_EX) == -1) {
(void)close(mfd) ;
close(mfd) ;
return pop_msg(p,POP_FAILURE, "flock: '%s': %s", p->temp_drop,
strerror(errno));
}
@@ -122,21 +122,21 @@ pop_dropcopy(POP *p, struct passwd *pwp)
see the new mail until the error goes away.
Should let them process the current backlog, in case
the error is a quota problem requiring deletions! */
(void)ftruncate(dfd,(int)offset) ;
ftruncate(dfd,(int)offset) ;
} else {
/* Mail transferred! Zero the mail drop NOW, that we
do not have to do gymnastics to figure out what's new
and what is old later */
(void)ftruncate(mfd,0) ;
ftruncate(mfd,0) ;
}
/* Close the actual mail drop */
(void)close (mfd);
close (mfd);
}
/* Acquire a stream pointer for the temporary maildrop */
if ( (p->drop = fdopen(dfd,"a+")) == NULL ) {
(void)close(dfd) ;
close(dfd) ;
return pop_msg(p,POP_FAILURE,"Cannot assign stream for %s",
p->temp_drop);
}

View File

@@ -79,7 +79,7 @@ pop_dropinfo(POP *p)
p->msg_count = ALLOC_MSGS;
p->mlp = (MsgInfoList *)calloc((unsigned)p->msg_count,sizeof(MsgInfoList));
if (p->mlp == NULL){
(void)fclose (p->drop);
fclose (p->drop);
p->msg_count = 0;
return pop_msg (p,POP_FAILURE,
"Can't build message list for '%s': Out of memory", p->user);
@@ -101,7 +101,7 @@ pop_dropinfo(POP *p)
p->mlp=(MsgInfoList *) realloc(p->mlp,
(p->msg_count+=ALLOC_MSGS)*sizeof(MsgInfoList));
if (p->mlp == NULL){
(void)fclose (p->drop);
fclose (p->drop);
p->msg_count = 0;
return pop_msg (p,POP_FAILURE,
"Can't build message list for '%s': Out of memory",

View File

@@ -47,12 +47,12 @@ pop_list (POP *p)
/* Loop through the message information list. Skip deleted messages */
for (i = p->msg_count, mp = p->mlp; i > 0; i--, mp++) {
if (!mp->del_flag)
(void)fprintf(p->output,"%u %lu\r\n",mp->number,mp->length);
fprintf(p->output,"%u %lu\r\n",mp->number,mp->length);
}
/* "." signals the end of a multi-line transmission */
(void)fprintf(p->output,".\r\n");
(void)fflush(p->output);
fprintf(p->output,".\r\n");
fflush(p->output);
return(POP_SUCCESS);
}

View File

@@ -29,13 +29,13 @@ pop_log(POP *p, int stat, char *format, ...)
int a3 = va_arg(ap, int);
int a4 = va_arg(ap, int);
int a5 = va_arg(ap, int);
(void)sprintf(msgbuf, format, a0, a1, a2, a3, a4, a5, 0, 4711);
sprintf(msgbuf, format, a0, a1, a2, a3, a4, a5, 0, 4711);
}
#endif /* HAVE_VSPRINTF */
if (p->debug && p->trace) {
(void)fprintf(p->trace,"%s\n",msgbuf);
(void)fflush(p->trace);
fprintf(p->trace,"%s\n",msgbuf);
fflush(p->trace);
}
else {
syslog (stat,"%s",msgbuf);

View File

@@ -25,9 +25,9 @@ pop_msg(POP *p, int stat, char *format, ...)
/* Format the POP status code at the beginning of the message */
if (stat == POP_SUCCESS)
(void)sprintf (mp,"%s ",POP_OK);
sprintf (mp,"%s ",POP_OK);
else
(void)sprintf (mp,"%s ",POP_ERR);
sprintf (mp,"%s ",POP_ERR);
/* Point past the POP status indicator in the message message */
mp += strlen(mp);
@@ -44,7 +44,7 @@ pop_msg(POP *p, int stat, char *format, ...)
int a3 = va_arg(ap, int);
int a4 = va_arg(ap, int);
int a5 = va_arg(ap, int);
(void)sprintf(mp, format, a0, a1, a2, a3, a4, a5, 0, 4711);
sprintf(mp, format, a0, a1, a2, a3, a4, a5, 0, 4711);
}
#endif /* HAVE_VSPRINTF */
@@ -59,11 +59,11 @@ pop_msg(POP *p, int stat, char *format, ...)
pop_log(p,POP_PRIORITY,"%s",message);
/* Append the <CR><LF> */
(void)strcat(message, "\r\n");
strcat(message, "\r\n");
/* Send the message to the client */
(void)fputs(message,p->output);
(void)fflush(p->output);
fputs(message,p->output);
fflush(p->output);
va_end(ap);
return(stat);

View File

@@ -87,10 +87,10 @@ pop_send(POP *p)
pop_msg(p,POP_SUCCESS,"%u octets",mp->length);
/* Position to the start of the message */
(void)fseek(p->drop,mp->offset,0);
fseek(p->drop,mp->offset,0);
/* Skip the first line (the sendmail "From" line) */
(void)fgets (buffer,MAXMSGLINELEN,p->drop);
fgets (buffer,MAXMSGLINELEN,p->drop);
#ifdef RETURN_PATH_HANDLING
return_path_sent = 0;
@@ -146,8 +146,8 @@ pop_send(POP *p)
return (pop_msg (p,POP_FAILURE,"SIGHUP or SIGPIPE flagged"));
}
/* "." signals the end of a multi-line transmission */
(void)fputs(".\r\n",p->output);
(void)fflush(p->output);
fputs(".\r\n",p->output);
fflush(p->output);
return(POP_SUCCESS);
}

View File

@@ -80,12 +80,12 @@ pop_uidl (POP *p)
/* Loop through the message information list. Skip deleted messages */
for (i = p->msg_count, mp = p->mlp; i > 0; i--, mp++) {
if (!mp->del_flag)
(void)fprintf(p->output,"%u %s\r\n",mp->number,mp->msg_id);
fprintf(p->output,"%u %s\r\n",mp->number,mp->msg_id);
}
/* "." signals the end of a multi-line transmission */
(void)fprintf(p->output,".\r\n");
(void)fflush(p->output);
fprintf(p->output,".\r\n");
fflush(p->output);
return(POP_SUCCESS);
}

View File

@@ -43,8 +43,8 @@ pop_updt (POP *p)
if (p->msgs_deleted == p->msg_count) {
/* Truncate before close, to avoid race condition, DO NOT UNLINK!
Another process may have opened, and not yet tried to lock */
(void)ftruncate ((int)fileno(p->drop),0);
(void)fclose(p->drop) ;
ftruncate ((int)fileno(p->drop),0);
fclose(p->drop) ;
return (POP_SUCCESS);
}
@@ -61,7 +61,7 @@ pop_updt (POP *p)
/* Lock the user's real mail drop */
if ( k_flock(mfd, K_LOCK_EX) == -1 ) {
(void)fclose(md) ;
fclose(md) ;
return pop_msg(p,POP_FAILURE, "flock: '%s': %s", p->temp_drop,
strerror(errno));
}
@@ -77,18 +77,18 @@ pop_updt (POP *p)
break ;
}
if ( nchar != 0 ) {
(void)fclose(md) ;
(void)ftruncate((int)fileno(p->drop),(int)offset) ;
(void)fclose(p->drop) ;
fclose(md) ;
ftruncate((int)fileno(p->drop),(int)offset) ;
fclose(p->drop) ;
return pop_msg(p,POP_FAILURE,standard_error);
}
rewind(md);
(void)ftruncate(mfd,0) ;
ftruncate(mfd,0) ;
/* Synch stdio and the kernel for the POP drop */
rewind(p->drop);
(void)lseek((int)fileno(p->drop),0,SEEK_SET);
lseek((int)fileno(p->drop),0,SEEK_SET);
/* Transfer messages not flagged for deletion from the temporary
maildrop to the new maildrop */
@@ -114,7 +114,7 @@ pop_updt (POP *p)
continue;
}
(void)fseek(p->drop,mp->offset,0);
fseek(p->drop,mp->offset,0);
#ifdef DEBUG
if(p->debug)
@@ -128,9 +128,9 @@ pop_updt (POP *p)
/* Update the message status */
if (strncasecmp(buffer,"Status:",7) == 0) {
if (mp->retr_flag)
(void)fputs("Status: RO\n",md);
fputs("Status: RO\n",md);
else
(void)fputs(buffer, md);
fputs(buffer, md);
status_written++;
continue;
}
@@ -139,19 +139,19 @@ pop_updt (POP *p)
doing_body = 1;
if (status_written == 0) {
if (mp->retr_flag)
(void)fputs("Status: RO\n\n",md);
fputs("Status: RO\n\n",md);
else
(void)fputs("Status: U\n\n",md);
fputs("Status: U\n\n",md);
}
else (void)fputs ("\n", md);
else fputs ("\n", md);
continue;
}
/* Save another header line */
(void)fputs (buffer, md);
fputs (buffer, md);
}
else { /* Body */
if (strncmp(buffer,"From ",5) == 0) break;
(void)fputs (buffer, md);
fputs (buffer, md);
}
}
}
@@ -159,16 +159,16 @@ pop_updt (POP *p)
/* flush and check for errors now! The new mail will writen
without stdio, since we need not separate messages */
(void)fflush(md) ;
fflush(md) ;
if (ferror(md)) {
(void)ftruncate(mfd,0) ;
(void)fclose(md) ;
(void)fclose(p->drop) ;
ftruncate(mfd,0) ;
fclose(md) ;
fclose(p->drop) ;
return pop_msg(p,POP_FAILURE,standard_error);
}
/* Go to start of new mail if any */
(void)lseek((int)fileno(p->drop),offset,SEEK_SET);
lseek((int)fileno(p->drop),offset,SEEK_SET);
while((nchar=read((int)fileno(p->drop),buffer,BUFSIZ)) > 0)
if ( nchar != write(mfd,buffer,nchar) ) {
@@ -176,16 +176,16 @@ pop_updt (POP *p)
break ;
}
if ( nchar != 0 ) {
(void)ftruncate(mfd,0) ;
(void)fclose(md) ;
(void)fclose(p->drop) ;
ftruncate(mfd,0) ;
fclose(md) ;
fclose(p->drop) ;
return pop_msg(p,POP_FAILURE,standard_error);
}
/* Close the maildrop and empty temporary maildrop */
(void)fclose(md);
(void)ftruncate((int)fileno(p->drop),0);
(void)fclose(p->drop);
fclose(md);
ftruncate((int)fileno(p->drop),0);
fclose(p->drop);
return(pop_quit(p));
}

View File

@@ -69,7 +69,7 @@ pop_xmit (POP *p)
_exit(1);
case -1:
#ifdef DEBUG
if (!p->debug) (void)unlink (temp_xmit);
if (!p->debug) unlink (temp_xmit);
#endif /* DEBUG */
return (pop_msg(p,POP_FAILURE,
"Unable to execute \"%s\"",MAIL_COMMAND));

View File

@@ -36,7 +36,7 @@ ring(int sig)
static char *
tgets(char *str, int size, FILE *fp, int timeout)
{
(void) signal(SIGALRM, ring);
signal(SIGALRM, ring);
alarm(timeout);
if (setjmp(env))
str = NULL;

View File

@@ -585,13 +585,13 @@ auth_wait(char *name)
if (Server && !authenticating)
return(0);
(void) signal(SIGALRM, auth_intr);
signal(SIGALRM, auth_intr);
alarm(30);
while (!authenticated)
if (telnet_spin())
break;
alarm(0);
(void) signal(SIGALRM, SIG_DFL);
signal(SIGALRM, SIG_DFL);
/*
* Now check to see if the user is valid or not

View File

@@ -317,7 +317,7 @@ krb5_data *outbuf;
if (retval = encode_krb5_enc_cred_part(&cred_enc_part, &scratch))
return retval;
#define cleanup_scratch() { (void) memset(scratch->data, 0, scratch->length); krb5_free_data(scratch); }
#define cleanup_scratch() { memset(scratch->data, 0, scratch->length); krb5_free_data(scratch); }
/* put together an eblock for this encryption */
@@ -340,7 +340,7 @@ krb5_data *outbuf;
}
#define cleanup_encpart() {\
(void) memset(ret_cred.enc_part.ciphertext.data, 0, \
memset(ret_cred.enc_part.ciphertext.data, 0, \
ret_cred.enc_part.ciphertext.length); \
free(ret_cred.enc_part.ciphertext.data); \
ret_cred.enc_part.ciphertext.length = 0; \
@@ -351,7 +351,7 @@ krb5_data *outbuf;
goto clean_encpart;
}
#define cleanup_prockey() {(void) krb5_finish_key(&eblock);}
#define cleanup_prockey() {krb5_finish_key(&eblock);}
/* call the encryption routine */
if (retval = krb5_encrypt((krb5_pointer) scratch->data,
@@ -470,14 +470,14 @@ const krb5_address *recv_addr; /* optional */
return retval;
}
#define cleanup_credmsg() {(void)krb5_xfree(credmsg->enc_part.ciphertext.data); (void)krb5_xfree(credmsg);}
#define cleanup_credmsg() {krb5_xfree(credmsg->enc_part.ciphertext.data); krb5_xfree(credmsg);}
if (!(scratch = (krb5_data *) malloc(sizeof(*scratch)))) {
cleanup_credmsg();
return ENOMEM;
}
#define cleanup_scratch() {(void)memset(scratch->data, 0, scratch->length); (void)krb5_xfree(scratch->data);}
#define cleanup_scratch() {memset(scratch->data, 0, scratch->length); krb5_xfree(scratch->data);}
if (retval = encode_krb5_ticket(credmsg->tickets[0], &scratch)) {
cleanup_credmsg();
@@ -516,7 +516,7 @@ const krb5_address *recv_addr; /* optional */
return retval;
}
#define cleanup_prockey() {(void) krb5_finish_key(&eblock);}
#define cleanup_prockey() {krb5_finish_key(&eblock);}
/* call the decryption routine */
if (retval = krb5_decrypt((krb5_pointer) credmsg->enc_part.ciphertext.data,
@@ -545,7 +545,7 @@ const krb5_address *recv_addr; /* optional */
}
cleanup_scratch();
#define cleanup_mesg() {(void)krb5_xfree(credmsg_enc_part);}
#define cleanup_mesg() {krb5_xfree(credmsg_enc_part);}
if (retval = krb5_timeofday(&currenttime)) {
cleanup_mesg();

View File

@@ -385,8 +385,8 @@ kerberos5_is(ap, data, cnt)
errout:
authdat = 0;
(void) strcpy(errbuf, "Read req failed: ");
(void) strcat(errbuf, error_message(r));
strcpy(errbuf, "Read req failed: ");
strcat(errbuf, error_message(r));
Data(ap, KRB_REJECT, errbuf, -1);
if (auth_debug_mode)
printf("%s\r\n", errbuf);
@@ -443,8 +443,8 @@ kerberos5_is(ap, data, cnt)
UserNameRequested)) {
char errbuf[128];
(void) strcpy(errbuf, "Read forwarded creds failed: ");
(void) strcat(errbuf, error_message(r));
strcpy(errbuf, "Read forwarded creds failed: ");
strcat(errbuf, error_message(r));
Data(ap, KRB_FORWARD_REJECT, errbuf, -1);
if (auth_debug_mode)
printf("Could not read forwarded credentials\r\n");

View File

@@ -102,15 +102,15 @@ local_des_read_pw_string(s,max,prompt,verify)
if (ioctl(0,TIOCSETP,(char *)&tty_state) == -1)
return -1;
while (!ok) {
(void) printf(prompt);
(void) fflush(stdout);
printf(prompt);
fflush(stdout);
while (!fgets(s, max, stdin));
if ((ptr = strchr(s, '\n')))
*ptr = '\0';
if (verify) {
printf("\nVerifying, please re-enter %s",prompt);
(void) fflush(stdout);
fflush(stdout);
if (!fgets(key_string, sizeof(key_string), stdin)) {
clearerr(stdin);
continue;
@@ -119,7 +119,7 @@ local_des_read_pw_string(s,max,prompt,verify)
*ptr = '\0';
if (strcmp(s,key_string)) {
printf("\n\07\07Mismatch - try again\n");
(void) fflush(stdout);
fflush(stdout);
continue;
}
}

View File

@@ -348,7 +348,7 @@ static int sendcmd(int argc, char **argv)
for (i = 1; i < argc; i++) {
if ((s = GETSEND(argv[i])) == 0) {
fprintf(stderr, "Telnet 'send' error - argument disappeared!\n");
(void) quit();
quit();
/*NOTREACHED*/
}
if (s->handler) {
@@ -1305,14 +1305,14 @@ setescape(argc, argv)
arg = argv[1];
else {
printf("new escape character: ");
(void) fgets(buf, sizeof(buf), stdin);
fgets(buf, sizeof(buf), stdin);
arg = buf;
}
if (arg[0] != '\0')
escape = arg[0];
printf("Escape character is '%s'.\n", control(escape));
(void) fflush(stdout);
fflush(stdout);
return 1;
}
@@ -1323,7 +1323,7 @@ togcrmod()
crmod = !crmod;
printf("Deprecated usage - please use 'toggle crmod' in the future.\n");
printf("%s map carriage return on output.\n", crmod ? "Will" : "Won't");
(void) fflush(stdout);
fflush(stdout);
return 1;
}
@@ -1337,7 +1337,7 @@ suspend()
long oldrows, oldcols, newrows, newcols, err;
err = (TerminalWindowSize(&oldrows, &oldcols) == 0) ? 1 : 0;
(void) kill(0, SIGTSTP);
kill(0, SIGTSTP);
/*
* If we didn't get the window size before the SUSPEND, but we
* can get them now (?), then send the NAWS to make sure that
@@ -1393,7 +1393,7 @@ shell(int argc, char **argv)
_exit(1);
}
default:
(void)wait((int *)0); /* Wait for the shell to complete */
wait((int *)0); /* Wait for the shell to complete */
if (TerminalWindowSize(&newrows, &newcols) && connected &&
(err || ((oldrows != newrows) || (oldcols != newcols)))) {
@@ -1409,9 +1409,9 @@ static int bye(int argc, char **argv)
extern int resettermname;
if (connected) {
(void) shutdown(net, 2);
shutdown(net, 2);
printf("Connection closed.\n");
(void) NetClose(net);
NetClose(net);
connected = 0;
resettermname = 1;
#if defined(AUTHENTICATION) || defined(ENCRYPTION)
@@ -1428,7 +1428,7 @@ static int bye(int argc, char **argv)
/*VARARGS*/
int quit(void)
{
(void) call(bye, "bye", "fromquit", 0);
call(bye, "bye", "fromquit", 0);
Exit(0);
return 0; /*NOTREACHED*/
}
@@ -1438,7 +1438,7 @@ int quit(void)
logout()
{
send_do(TELOPT_LOGOUT, 1);
(void) netflush();
netflush();
return 1;
}
@@ -2058,7 +2058,7 @@ static int status(int argc, char **argv)
printf("No connection.\n");
}
printf("Escape character is '%s'.\n", control(escape));
(void) fflush(stdout);
fflush(stdout);
return 1;
}
@@ -2068,7 +2068,7 @@ static int status(int argc, char **argv)
*/
ayt_status()
{
(void) call(status, "status", "notmuch", 0);
call(status, "status", "notmuch", 0);
}
#endif
@@ -2180,9 +2180,9 @@ int tn(int argc, char **argv)
return 0;
}
if (argc < 2) {
(void) strcpy(line, "open ");
strcpy(line, "open ");
printf("(to) ");
(void) fgets(&line[strlen(line)], sizeof(line) - strlen(line), stdin);
fgets(&line[strlen(line)], sizeof(line) - strlen(line), stdin);
makeargv();
argc = margc;
argv = margv;
@@ -2248,7 +2248,7 @@ int tn(int argc, char **argv)
if (temp != (unsigned long) -1) {
sin.sin_addr.s_addr = temp;
sin.sin_family = AF_INET;
(void) strcpy(_hostname, hostp);
strcpy(_hostname, hostp);
hostname = _hostname;
} else {
host = gethostbyname(hostp);
@@ -2353,7 +2353,7 @@ int tn(int argc, char **argv)
host->h_addr_list++;
memmove((caddr_t)&sin.sin_addr,
host->h_addr_list[0], host->h_length);
(void) NetClose(net);
NetClose(net);
continue;
}
#endif /* defined(h_addr) */
@@ -2382,10 +2382,10 @@ int tn(int argc, char **argv)
env_define((unsigned char *)"USER", (unsigned char *)user);
env_export((unsigned char *)"USER");
}
(void) call(status, "status", "notmuch", 0);
call(status, "status", "notmuch", 0);
if (setjmp(peerdied) == 0)
telnet(user);
(void) NetClose(net);
NetClose(net);
ExitString("Connection closed by foreign host.\n",1);
/*NOTREACHED*/
}
@@ -2493,8 +2493,8 @@ command(top, tbuf, cnt)
if (!top) {
putchar('\n');
} else {
(void) signal(SIGINT, SIG_DFL);
(void) signal(SIGQUIT, SIG_DFL);
signal(SIGINT, SIG_DFL);
signal(SIGQUIT, SIG_DFL);
}
for (;;) {
if (rlogin == _POSIX_VDISABLE)
@@ -2516,7 +2516,7 @@ command(top, tbuf, cnt)
printf("%s> ", prompt);
if (fgets(line, sizeof(line), stdin) == NULL) {
if (feof(stdin) || ferror(stdin)) {
(void) quit();
quit();
/*NOTREACHED*/
}
break;

View File

@@ -229,7 +229,7 @@ int main(int argc, char **argv)
extern char *dest_realm, dst_realm_buf[];
extern int dst_realm_sz;
dest_realm = dst_realm_buf;
(void)strncpy(dest_realm, optarg, dst_realm_sz);
strncpy(dest_realm, optarg, dst_realm_sz);
}
#else
fprintf(stderr,
@@ -306,7 +306,7 @@ int main(int argc, char **argv)
else
return (1);
}
(void)setjmp(toplevel);
setjmp(toplevel);
for (;;) {
command(1, 0, 0);
}

View File

@@ -95,7 +95,7 @@ stilloob()
if (value < 0) {
perror("select");
(void) quit();
quit();
/* NOTREACHED */
}
if (FD_ISSET(net, &excepts)) {
@@ -157,7 +157,7 @@ netflush()
if (errno != ENOBUFS && errno != EWOULDBLOCK) {
setcommandmode();
perror(hostname);
(void)NetClose(net);
NetClose(net);
ring_clear_mark(&netoring);
longjmp(peerdied, -1);
/*NOTREACHED*/
@@ -174,7 +174,7 @@ netflush()
* up the other half.
*/
if ((n1 == n) && ring_full_consecutive(&netoring)) {
(void) netflush();
netflush();
}
return 1;
} else {

View File

@@ -213,9 +213,9 @@ void
TerminalFlushOutput()
{
#ifdef TIOCFLUSH
(void) ioctl(fileno(stdout), TIOCFLUSH, (char *) 0);
ioctl(fileno(stdout), TIOCFLUSH, (char *) 0);
#else
(void) ioctl(fileno(stdout), TCFLSH, (char *) 0);
ioctl(fileno(stdout), TCFLSH, (char *) 0);
#endif
}
@@ -487,10 +487,10 @@ TerminalNewMode(int f)
#endif
#ifdef SIGTSTP
(void) signal(SIGTSTP, susp);
signal(SIGTSTP, susp);
#endif /* SIGTSTP */
#ifdef SIGINFO
(void) signal(SIGINFO, ayt);
signal(SIGINFO, ayt);
#endif
#ifdef NOKERNINFO
tmp_tc.c_lflag |= NOKERNINFO;
@@ -526,10 +526,10 @@ TerminalNewMode(int f)
#ifdef SIGINFO
RETSIGTYPE ayt_status();
(void) signal(SIGINFO, ayt_status);
signal(SIGINFO, ayt_status);
#endif
#ifdef SIGTSTP
(void) signal(SIGTSTP, SIG_DFL);
signal(SIGTSTP, SIG_DFL);
sigemptyset(&sm);
sigaddset(&sm, SIGTSTP);
sigprocmask(SIG_UNBLOCK, &sm, NULL);
@@ -757,17 +757,17 @@ ayt(sig)
void
sys_telnet_init()
{
(void) signal(SIGINT, intr);
(void) signal(SIGQUIT, intr2);
(void) signal(SIGPIPE, deadpeer);
signal(SIGINT, intr);
signal(SIGQUIT, intr2);
signal(SIGPIPE, deadpeer);
#ifdef SIGWINCH
(void) signal(SIGWINCH, sendwin);
signal(SIGWINCH, sendwin);
#endif
#ifdef SIGTSTP
(void) signal(SIGTSTP, susp);
signal(SIGTSTP, susp);
#endif
#ifdef SIGINFO
(void) signal(SIGINFO, ayt);
signal(SIGINFO, ayt);
#endif
setconnmode(0);
@@ -845,7 +845,7 @@ process_rings(netin, netout, netex, ttyin, ttyout, poll)
if (FD_ISSET(net, &xbits)) {
FD_CLR(net, &xbits);
SYNCHing = 1;
(void) ttyflush(1); /* flush already enqueued data */
ttyflush(1); /* flush already enqueued data */
}
/*

View File

@@ -1208,7 +1208,7 @@ slc_export()
}
}
slc_end_reply();
(void)slc_update();
slc_update();
setconnmode(1); /* Make sure the character values are set */
}
@@ -1688,7 +1688,7 @@ process_iac:
*/
printoption("RCVD", IAC, DM);
SYNCHing = 1;
(void) ttyflush(1);
ttyflush(1);
SYNCHing = stilloob();
settimer(gotDM);
break;
@@ -2134,7 +2134,7 @@ doflush()
NETADD(TELOPT_TM);
flushline = 1;
flushout = 1;
(void) ttyflush(1); /* Flush/drop output */
ttyflush(1); /* Flush/drop output */
/* do printoption AFTER flush, otherwise the output gets tossed... */
printoption("SENT", DO, TELOPT_TM);
}

View File

@@ -857,13 +857,13 @@ EmptyTerminal(void)
if (TTYBYTES() == 0) {
FD_SET(tout, &outs);
(void) select(tout+1, 0, &outs, 0,
select(tout+1, 0, &outs, 0,
(struct timeval *) 0); /* wait for TTLOWAT */
} else {
while (TTYBYTES()) {
(void) ttyflush(0);
ttyflush(0);
FD_SET(tout, &outs);
(void) select(tout+1, 0, &outs, 0,
select(tout+1, 0, &outs, 0,
(struct timeval *) 0); /* wait for TTLOWAT */
}
}
@@ -874,7 +874,7 @@ SetForExit(void)
{
setconnmode(0);
do {
(void)telrcv(); /* Process any incoming data */
telrcv(); /* Process any incoming data */
EmptyTerminal();
} while (ring_full_count(&netiring)); /* While there is any */
setcommandmode();

View File

@@ -159,7 +159,7 @@ start_slc(getit)
slcchange = 0;
if (getit)
init_termbuf();
(void) sprintf((char *)slcbuf, "%c%c%c%c",
sprintf((char *)slcbuf, "%c%c%c%c",
IAC, SB, TELOPT_LINEMODE, LM_SLC);
slcptr = slcbuf + 4;
@@ -200,7 +200,7 @@ end_slc(bufp)
*bufp = &slcbuf[4];
return(slcptr - slcbuf - 4);
} else {
(void) sprintf((char *)slcptr, "%c%c", IAC, SE);
sprintf((char *)slcptr, "%c%c", IAC, SE);
slcptr += 2;
len = slcptr - slcbuf;
writenet(slcbuf, len);
@@ -483,7 +483,7 @@ deferslc()
if (def_slcbuf) {
start_slc(1);
do_opt_slc(def_slcbuf, def_slclen);
(void) end_slc(0);
end_slc(0);
free(def_slcbuf);
def_slcbuf = (unsigned char *)0;
def_slclen = 0;

View File

@@ -436,7 +436,7 @@ send_do(int option, int init)
set_his_want_state_will(option);
do_dont_resp[option]++;
}
(void) sprintf(nfrontp, (char *)doopt, option);
sprintf(nfrontp, (char *)doopt, option);
nfrontp += sizeof (dont) - 2;
DIAG(TD_OPTIONS, printoption("td: send do", option));
@@ -655,7 +655,7 @@ send_dont(int option, int init)
set_his_want_state_wont(option);
do_dont_resp[option]++;
}
(void) sprintf(nfrontp, (char *)dont, option);
sprintf(nfrontp, (char *)dont, option);
nfrontp += sizeof (doopt) - 2;
DIAG(TD_OPTIONS, printoption("td: send dont", option));
@@ -802,7 +802,7 @@ send_will(int option, int init)
set_my_want_state_will(option);
will_wont_resp[option]++;
}
(void) sprintf(nfrontp, (char *)will, option);
sprintf(nfrontp, (char *)will, option);
nfrontp += sizeof (doopt) - 2;
DIAG(TD_OPTIONS, printoption("td: send will", option));
@@ -914,7 +914,7 @@ dooption(int option)
set_my_want_state_will(TELOPT_LOGOUT);
send_will(TELOPT_LOGOUT, 0);
set_my_state_will(TELOPT_LOGOUT);
(void)netflush();
netflush();
cleanup(0);
/* NOT REACHED */
break;
@@ -959,7 +959,7 @@ send_wont(int option, int init)
set_my_want_state_wont(option);
will_wont_resp[option]++;
}
(void) sprintf(nfrontp, (char *)wont, option);
sprintf(nfrontp, (char *)wont, option);
nfrontp += sizeof (wont) - 2;
DIAG(TD_OPTIONS, printoption("td: send wont", option));
@@ -1177,7 +1177,7 @@ suboption(void)
*/
start_slc(1);
do_opt_slc(subpointer, subend - subpointer);
(void) end_slc(0);
end_slc(0);
break;
} else if (request == LM_MODE) {
if (SB_EOF())
@@ -1229,7 +1229,7 @@ suboption(void)
return;
settimer(xdisplocsubopt);
subpointer[SB_LEN()] = '\0';
(void)setenv("DISPLAY", (char *)subpointer, 1);
setenv("DISPLAY", (char *)subpointer, 1);
break;
} /* end of case TELOPT_XDISPLOC */
@@ -1396,7 +1396,7 @@ suboption(void)
case ENV_USERVAR:
*cp = '\0';
if (valp)
(void)setenv(varp, valp, 1);
setenv(varp, valp, 1);
else
unsetenv(varp);
cp = varp = (char *)subpointer;
@@ -1415,7 +1415,7 @@ suboption(void)
}
*cp = '\0';
if (valp)
(void)setenv(varp, valp, 1);
setenv(varp, valp, 1);
else
unsetenv(varp);
break;

View File

@@ -87,7 +87,7 @@ char wtmpf[] = "/etc/wtmp";
#include <sys/stropts.h>
#endif
#define SCPYN(a, b) (void) strncpy(a, b, sizeof(a))
#define SCPYN(a, b) strncpy(a, b, sizeof(a))
#define SCMPN(a, b) strncmp(a, b, sizeof(a))
#ifdef HAVE_SYS_STREAM_H
@@ -173,10 +173,10 @@ init_termbuf(void)
{
# ifdef STREAMSPTY
if (really_stream)
(void) tcgetattr(ttyfd, &termbuf);
tcgetattr(ttyfd, &termbuf);
else
# endif
(void) tcgetattr(ourpty, &termbuf);
tcgetattr(ourpty, &termbuf);
termbuf2 = termbuf;
}
@@ -202,10 +202,10 @@ set_termbuf(void)
if (memcmp((char *)&termbuf, (char *)&termbuf2, sizeof(termbuf)))
# ifdef STREAMSPTY
if (really_stream)
(void) tcsetattr(ttyfd, TCSANOW, &termbuf);
tcsetattr(ttyfd, TCSANOW, &termbuf);
else
# endif
(void) tcsetattr(ourpty, TCSANOW, &termbuf);
tcsetattr(ourpty, TCSANOW, &termbuf);
}
@@ -451,11 +451,11 @@ int getpty(int *ptynum)
#ifndef CRAY
#ifndef __hpux
(void) sprintf(line, "/dev/ptyXX");
sprintf(line, "/dev/ptyXX");
p1 = &line[8];
p2 = &line[9];
#else
(void) sprintf(line, "/dev/ptym/ptyXX");
sprintf(line, "/dev/ptym/ptyXX");
p1 = &line[13];
p2 = &line[14];
#endif
@@ -503,23 +503,23 @@ int getpty(int *ptynum)
struct stat sb;
for (*ptynum = lowpty; *ptynum <= highpty; (*ptynum)++) {
(void) sprintf(myline, "/dev/pty/%03d", *ptynum);
sprintf(myline, "/dev/pty/%03d", *ptynum);
p = open(myline, 2);
if (p < 0)
continue;
(void) sprintf(line, "/dev/ttyp%03d", *ptynum);
sprintf(line, "/dev/ttyp%03d", *ptynum);
/*
* Here are some shenanigans to make sure that there
* are no listeners lurking on the line.
*/
if(stat(line, &sb) < 0) {
(void) close(p);
close(p);
continue;
}
if(sb.st_uid || sb.st_gid || sb.st_mode != 0600) {
chown(line, 0, 0);
chmod(line, 0600);
(void)close(p);
close(p);
p = open(myline, 2);
if (p < 0)
continue;
@@ -531,7 +531,7 @@ int getpty(int *ptynum)
return(p);
else {
/* no tty side to pty so skip it */
(void) close(p);
close(p);
}
}
#endif /* CRAY */
@@ -576,7 +576,7 @@ tty_setlinemode(on)
{
#ifdef TIOCEXT
set_termbuf();
(void) ioctl(ourpty, TIOCEXT, (char *)&on);
ioctl(ourpty, TIOCEXT, (char *)&on);
init_termbuf();
#else /* !TIOCEXT */
# ifdef EXTPROC
@@ -967,8 +967,8 @@ void getptyslave(void)
# ifdef TIOCNOTTY
t = open(_PATH_TTY, O_RDWR);
if (t >= 0) {
(void) ioctl(t, TIOCNOTTY, (char *)0);
(void) close(t);
ioctl(t, TIOCNOTTY, (char *)0);
close(t);
}
# endif
#endif
@@ -1023,7 +1023,7 @@ void getptyslave(void)
memset((char *)&ws, 0, sizeof(ws));
ws.ws_col = def_col;
ws.ws_row = def_row;
(void)ioctl(t, TIOCSWINSZ, (char *)&ws);
ioctl(t, TIOCSWINSZ, (char *)&ws);
}
# endif
@@ -1069,7 +1069,7 @@ void getptyslave(void)
if (login_tty(t) == -1)
fatalperror(net, "login_tty");
if (net > 2)
(void) close(net);
close(net);
#if defined(AUTHENTICATION) && defined(NO_LOGIN_F) && defined(LOGIN_R)
/*
* Leave the pty open so that we can write out the rlogin
@@ -1077,7 +1077,7 @@ void getptyslave(void)
*/
#else
if (ourpty > 2) {
(void) close(ourpty);
close(ourpty);
ourpty = -1;
}
#endif
@@ -1103,12 +1103,12 @@ int cleanopen(char *line)
* Make sure that other people can't open the
* slave side of the connection.
*/
(void) chown(line, 0, 0);
(void) chmod(line, 0600);
chown(line, 0, 0);
chmod(line, 0600);
}
# if !defined(CRAY) && (BSD > 43)
(void) revoke(line);
revoke(line);
# endif
t = open(line, O_RDWR|O_NOCTTY);
@@ -1121,12 +1121,12 @@ int cleanopen(char *line)
* ourselves.
*/
# if !(defined(CRAY) || defined(__hpux)) && (BSD <= 43) && !defined(STREAMSPTY)
(void) signal(SIGHUP, SIG_IGN);
signal(SIGHUP, SIG_IGN);
#ifdef HAVE_VHANGUP
vhangup();
#else
#endif
(void) signal(SIGHUP, SIG_DFL);
signal(SIGHUP, SIG_DFL);
t = open(line, O_RDWR|O_NOCTTY);
if (t < 0)
return(-1);
@@ -1134,15 +1134,15 @@ int cleanopen(char *line)
# if defined(CRAY) && defined(TCVHUP)
{
int i;
(void) signal(SIGHUP, SIG_IGN);
(void) ioctl(t, TCVHUP, (char *)0);
(void) signal(SIGHUP, SIG_DFL);
signal(SIGHUP, SIG_IGN);
ioctl(t, TCVHUP, (char *)0);
signal(SIGHUP, SIG_DFL);
i = open(line, O_RDWR);
if (i < 0)
return(-1);
(void) close(t);
close(t);
t = i;
}
# endif /* defined(CRAY) && defined(TCVHUP) */
@@ -1189,19 +1189,19 @@ int login_tty(int t)
* it out before opening the tty...
*/
#if defined HAVE_SETPGID
(void) setpgid(0, 0);
setpgid(0, 0);
#else
(void) setpgrp(0, 0); /* if setpgid isn't available, setpgrp
setpgrp(0, 0); /* if setpgid isn't available, setpgrp
probably takes arguments */
#endif
close(open(line, O_RDWR));
# endif
if (t != 0)
(void) dup2(t, 0);
dup2(t, 0);
if (t != 1)
(void) dup2(t, 1);
dup2(t, 1);
if (t != 2)
(void) dup2(t, 2);
dup2(t, 2);
if (t > 2)
close(t);
return(0);
@@ -1262,7 +1262,7 @@ startslave(char *host, int autologin, char *autoname)
/*
* Create utmp entry for child
*/
(void) time(&wtmp.ut_time);
time(&wtmp.ut_time);
wtmp.ut_type = LOGIN_PROCESS;
wtmp.ut_pid = pid;
SCPYN(wtmp.ut_user, "LOGIN");
@@ -1276,11 +1276,11 @@ startslave(char *host, int autologin, char *autoname)
pututline(&wtmp);
endutent();
if ((i = open(wtmpf, O_WRONLY|O_APPEND)) >= 0) {
(void) write(i, (char *)&wtmp, sizeof(struct utmp));
(void) close(i);
write(i, (char *)&wtmp, sizeof(struct utmp));
close(i);
}
#ifdef CRAY
(void) signal(WJSIGNAL, sigjob);
signal(WJSIGNAL, sigjob);
#endif
utmp_sig_notify(pid);
# endif /* PARENT_DOES_UTMP */
@@ -1653,7 +1653,7 @@ static
void
rmut(void)
{
f;
int f;
int found = 0;
struct utmp *u, *utmp;
int nutmp;
@@ -1661,7 +1661,7 @@ rmut(void)
f = open(utmpf, O_RDWR);
if (f >= 0) {
(void) fstat(f, &statbf);
fstat(f, &statbf);
utmp = (struct utmp *)malloc((unsigned)statbf.st_size);
if (!utmp)
syslog(LOG_ERR, "utmp malloc failed");
@@ -1673,17 +1673,17 @@ rmut(void)
if (SCMPN(u->ut_line, line+5) ||
u->ut_name[0]==0)
continue;
(void) lseek(f, ((long)u)-((long)utmp), L_SET);
lseek(f, ((long)u)-((long)utmp), L_SET);
SCPYN(u->ut_name, "");
#ifdef HAVE_UT_HOST
SCPYN(u->ut_host, "");
#endif
(void) time(&u->ut_time);
(void) write(f, (char *)u, sizeof(wtmp));
time(&u->ut_time);
write(f, (char *)u, sizeof(wtmp));
found++;
}
}
(void) close(f);
close(f);
}
if (found) {
f = open(wtmpf, O_WRONLY|O_APPEND);
@@ -1693,16 +1693,16 @@ rmut(void)
#ifdef HAVE_UT_HOST
SCPYN(wtmp.ut_host, "");
#endif
(void) time(&wtmp.ut_time);
(void) write(f, (char *)&wtmp, sizeof(wtmp));
(void) close(f);
time(&wtmp.ut_time);
write(f, (char *)&wtmp, sizeof(wtmp));
close(f);
}
}
(void) chmod(line, 0666);
(void) chown(line, 0, 0);
chmod(line, 0666);
chown(line, 0, 0);
line[strlen("/dev/")] = 'p';
(void) chmod(line, 0666);
(void) chown(line, 0, 0);
chmod(line, 0666);
chown(line, 0, 0);
} /* end of rmut */
#endif /* CRAY */
@@ -1716,24 +1716,24 @@ rmut (char *line)
int fd; /* for /etc/wtmp */
utmp.ut_type = USER_PROCESS;
(void) strncpy(utmp.ut_id, line+12, sizeof(utmp.ut_id));
(void) setutent();
strncpy(utmp.ut_id, line+12, sizeof(utmp.ut_id));
setutent();
utptr = getutid(&utmp);
/* write it out only if it exists */
if (utptr) {
utptr->ut_type = DEAD_PROCESS;
utptr->ut_time = time((long *) 0);
(void) pututline(utptr);
pututline(utptr);
/* set wtmp entry if wtmp file exists */
if ((fd = open(wtmpf, O_WRONLY | O_APPEND)) >= 0) {
(void) write(fd, utptr, sizeof(utmp));
(void) close(fd);
write(fd, utptr, sizeof(utmp));
close(fd);
}
}
(void) endutent();
endutent();
(void) chmod(line, 0666);
(void) chown(line, 0, 0);
chmod(line, 0666);
chown(line, 0, 0);
line[14] = line[13];
line[13] = line[12];
line[8] = 'm';
@@ -1741,8 +1741,8 @@ rmut (char *line)
line[10] = 'p';
line[11] = 't';
line[12] = 'y';
(void) chmod(line, 0666);
(void) chown(line, 0, 0);
chmod(line, 0666);
chown(line, 0, 0);
}
#endif
@@ -1797,7 +1797,7 @@ cleanup(int sig)
# endif /* CRAY */
rmut(line);
close(ourpty);
(void) shutdown(net, 2);
shutdown(net, 2);
# ifdef CRAY
if (t == 0)
cleantmp(&wtmp);
@@ -1852,7 +1852,7 @@ _utmp_sig_rcv(sig)
int sig;
{
caught = 1;
(void) signal(SIGUSR1, func);
signal(SIGUSR1, func);
}
void
@@ -1868,7 +1868,7 @@ utmp_sig_init()
void
utmp_sig_reset()
{
(void) signal(SIGUSR1, func); /* reset handler to default */
signal(SIGUSR1, func); /* reset handler to default */
}
# ifdef __hpux

View File

@@ -643,12 +643,12 @@ getterminaltype(name)
* we have to just go with what we (might) have already gotten.
*/
if (his_state_is_will(TELOPT_TTYPE) && !terminaltypeok(terminaltype)) {
(void) strncpy(first, terminaltype, sizeof(first));
strncpy(first, terminaltype, sizeof(first));
for(;;) {
/*
* Save the unknown name, and request the next name.
*/
(void) strncpy(last, terminaltype, sizeof(last));
strncpy(last, terminaltype, sizeof(last));
_gettermname();
if (terminaltypeok(terminaltype))
break;
@@ -667,7 +667,7 @@ getterminaltype(name)
*/
_gettermname();
if (strncmp(first, terminaltype, sizeof(first)) != 0)
(void) strcpy(terminaltype, first);
strcpy(terminaltype, first);
break;
}
}
@@ -779,7 +779,7 @@ void doit(struct sockaddr_in *who)
remote_host_name[sizeof(remote_host_name)-1] = 0;
host = remote_host_name;
(void) k_gethostname(host_name, sizeof (host_name));
k_gethostname(host_name, sizeof (host_name));
hostname = host_name;
#ifndef abs
@@ -976,34 +976,34 @@ telnet(f, p)
*/
telrcv();
(void) ioctl(f, FIONBIO, (char *)&on);
(void) ioctl(p, FIONBIO, (char *)&on);
ioctl(f, FIONBIO, (char *)&on);
ioctl(p, FIONBIO, (char *)&on);
#if defined(SO_OOBINLINE)
(void) setsockopt(net, SOL_SOCKET, SO_OOBINLINE,
setsockopt(net, SOL_SOCKET, SO_OOBINLINE,
(void *)&on, sizeof on);
#endif /* defined(SO_OOBINLINE) */
#ifdef SIGTSTP
(void) signal(SIGTSTP, SIG_IGN);
signal(SIGTSTP, SIG_IGN);
#endif
#ifdef SIGTTOU
/*
* Ignoring SIGTTOU keeps the kernel from blocking us
* in ttioct() in /sys/tty.c.
*/
(void) signal(SIGTTOU, SIG_IGN);
signal(SIGTTOU, SIG_IGN);
#endif
(void) signal(SIGCHLD, cleanup);
signal(SIGCHLD, cleanup);
#ifdef TIOCNOTTY
{
int t;
t = open(_PATH_TTY, O_RDWR);
if (t >= 0) {
(void) ioctl(t, TIOCNOTTY, (char *)0);
(void) close(t);
ioctl(t, TIOCNOTTY, (char *)0);
close(t);
}
}
#endif
@@ -1027,7 +1027,7 @@ telnet(f, p)
HN = getstr("hn", &cp);
IM = getstr("im", &cp);
if (HN && *HN)
(void) strcpy(host_name, HN);
strcpy(host_name, HN);
if (IM == 0)
IM = "";
} else {
@@ -1039,7 +1039,7 @@ telnet(f, p)
putf(IM, ptyibuf2);
if (pcc)
(void) strncat(ptyibuf2, ptyip, pcc+1);
strncat(ptyibuf2, ptyip, pcc+1);
ptyip = ptyibuf2;
pcc = strlen(ptyip);
#ifdef LINEMODE
@@ -1143,7 +1143,7 @@ telnet(f, p)
if (SYNCHing) {
int atmark;
(void) ioctl(net, SIOCATMARK, (char *)&atmark);
ioctl(net, SIOCATMARK, (char *)&atmark);
if (atmark) {
ncc = recv(net, netibuf, sizeof (netibuf), MSG_OOB);
if ((ncc == -1) && (errno == EINVAL)) {
@@ -1235,7 +1235,7 @@ telnet(f, p)
ptyibuf[0] & TIOCPKT_DOSTOP ? 1 : 0;
if (newflow != flowmode) {
flowmode = newflow;
(void) sprintf(nfrontp,
sprintf(nfrontp,
"%c%c%c%c%c%c",
IAC, SB, TELOPT_LFLOW,
flowmode ? LFLOW_ON
@@ -1392,12 +1392,12 @@ interrupt()
if (really_stream)
{
int sig = SIGINT;
(void) ioctl(ourpty, TIOCSIGNAL, &sig);
(void) ioctl(ourpty, I_FLUSH, FLUSHR);
ioctl(ourpty, TIOCSIGNAL, &sig);
ioctl(ourpty, I_FLUSH, FLUSHR);
}
#else
#ifdef TCSIG
(void) ioctl(ourpty, TCSIG, (char *)SIGINT);
ioctl(ourpty, TCSIG, (char *)SIGINT);
#else /* TCSIG */
init_termbuf();
*pfrontp++ = slctab[SLC_IP].sptr ?
@@ -1416,7 +1416,7 @@ sendbrk()
{
ptyflush(); /* half-hearted */
#ifdef TCSIG
(void) ioctl(ourpty, TCSIG, (char *)SIGQUIT);
ioctl(ourpty, TCSIG, (char *)SIGQUIT);
#else /* TCSIG */
init_termbuf();
*pfrontp++ = slctab[SLC_ABORT].sptr ?
@@ -1430,7 +1430,7 @@ sendsusp()
#ifdef SIGTSTP
ptyflush(); /* half-hearted */
# ifdef TCSIG
(void) ioctl(ourpty, TCSIG, (char *)SIGTSTP);
ioctl(ourpty, TCSIG, (char *)SIGTSTP);
# else /* TCSIG */
*pfrontp++ = slctab[SLC_SUSP].sptr ?
(unsigned char)*slctab[SLC_SUSP].sptr : '\032';
@@ -1447,11 +1447,11 @@ recv_ayt()
{
#if defined(SIGINFO) && defined(TCSIG)
if (slctab[SLC_AYT].sptr && *slctab[SLC_AYT].sptr != _POSIX_VDISABLE) {
(void) ioctl(ourpty, TCSIG, (char *)SIGINFO);
ioctl(ourpty, TCSIG, (char *)SIGINFO);
return;
}
#endif
(void) strcpy(nfrontp, "\r\n[Yes]\r\n");
strcpy(nfrontp, "\r\n[Yes]\r\n");
nfrontp += 9;
}

View File

@@ -276,7 +276,7 @@ localstat()
# endif /* KLUDGELINEMODE */
send_do(TELOPT_LINEMODE, 1);
/* send along edit modes */
(void) sprintf(nfrontp, "%c%c%c%c%c%c%c", IAC, SB,
sprintf(nfrontp, "%c%c%c%c%c%c%c", IAC, SB,
TELOPT_LINEMODE, LM_MODE, useeditmode,
IAC, SE);
nfrontp += 7;
@@ -305,7 +305,7 @@ localstat()
/*
* Send along appropriate edit mode mask.
*/
(void) sprintf(nfrontp, "%c%c%c%c%c%c%c", IAC, SB,
sprintf(nfrontp, "%c%c%c%c%c%c%c", IAC, SB,
TELOPT_LINEMODE, LM_MODE, useeditmode,
IAC, SE);
nfrontp += 7;
@@ -318,7 +318,7 @@ localstat()
*/
start_slc(0);
check_slc();
(void) end_slc(0);
end_slc(0);
}
done:
@@ -352,7 +352,7 @@ flowstat()
if (his_state_is_will(TELOPT_LFLOW)) {
if (tty_flowmode() != flowmode) {
flowmode = tty_flowmode();
(void) sprintf(nfrontp, "%c%c%c%c%c%c",
sprintf(nfrontp, "%c%c%c%c%c%c",
IAC, SB, TELOPT_LFLOW,
flowmode ? LFLOW_ON : LFLOW_OFF,
IAC, SE);
@@ -360,7 +360,7 @@ flowstat()
}
if (tty_restartany() != restartany) {
restartany = tty_restartany();
(void) sprintf(nfrontp, "%c%c%c%c%c%c",
sprintf(nfrontp, "%c%c%c%c%c%c",
IAC, SB, TELOPT_LFLOW,
restartany ? LFLOW_RESTART_ANY
: LFLOW_RESTART_XON,
@@ -438,7 +438,7 @@ clientstat(code, parm1, parm2)
useeditmode |= MODE_SOFT_TAB;
if (tty_islitecho())
useeditmode |= MODE_LIT_ECHO;
(void) sprintf(nfrontp, "%c%c%c%c%c%c%c", IAC,
sprintf(nfrontp, "%c%c%c%c%c%c%c", IAC,
SB, TELOPT_LINEMODE, LM_MODE,
useeditmode, IAC, SE);
nfrontp += 7;
@@ -497,7 +497,7 @@ clientstat(code, parm1, parm2)
set_termbuf();
if (!ack) {
(void) sprintf(nfrontp, "%c%c%c%c%c%c%c", IAC,
sprintf(nfrontp, "%c%c%c%c%c%c%c", IAC,
SB, TELOPT_LINEMODE, LM_MODE,
useeditmode|MODE_ACK,
IAC, SE);
@@ -534,7 +534,7 @@ clientstat(code, parm1, parm2)
ws.ws_col = parm1;
ws.ws_row = parm2;
(void) ioctl(ourpty, TIOCSWINSZ, (char *)&ws);
ioctl(ourpty, TIOCSWINSZ, (char *)&ws);
}
#endif /* TIOCSWINSZ */
@@ -602,7 +602,7 @@ defer_terminit()
memset((char *)&ws, 0, sizeof(ws));
ws.ws_col = def_col;
ws.ws_row = def_row;
(void) ioctl(ourpty, TIOCSWINSZ, (char *)&ws);
ioctl(ourpty, TIOCSWINSZ, (char *)&ws);
}
#endif

View File

@@ -346,7 +346,7 @@ void fatal(int f, char *msg)
{
char buf[BUFSIZ];
(void) sprintf(buf, "telnetd: %s.\r\n", msg);
sprintf(buf, "telnetd: %s.\r\n", msg);
#if defined(ENCRYPTION)
if (encrypt_output) {
/*
@@ -357,7 +357,7 @@ void fatal(int f, char *msg)
netflush();
}
#endif
(void) write(f, buf, (int)strlen(buf));
write(f, buf, (int)strlen(buf));
sleep(1); /*XXX*/
exit(1);
}
@@ -367,7 +367,7 @@ fatalperror(int f, char *msg)
{
char buf[BUFSIZ], *strerror(int);
(void) sprintf(buf, "%s: %s", msg, strerror(errno));
sprintf(buf, "%s: %s", msg, strerror(errno));
fatal(f, buf);
}
@@ -403,7 +403,7 @@ void edithost(char *pat, char *host)
pat++;
}
if (*host)
(void) strncpy(res, host,
strncpy(res, host,
sizeof editedhost - (res - editedhost) -1);
else
*res = '\0';
@@ -499,8 +499,8 @@ void putf(char *cp, char *where)
break;
case 'd':
(void)time(&t);
(void)strftime(db, sizeof(db), fmtstr, localtime(&t));
time(&t);
strftime(db, sizeof(db), fmtstr, localtime(&t));
putstr(db);
break;

View File

@@ -505,10 +505,10 @@ countdown(XtPointer _t, XtIntervalId *_d)
}
seconds = time(0) - locked_at;
if (seconds >= 3600)
(void) sprintf(buf, "Locked for %d:%02d:%02d ",
sprintf(buf, "Locked for %d:%02d:%02d ",
(int)seconds/3600, (int)seconds/60%60, (int)seconds%60);
else
(void) sprintf(buf, "Locked for %2d:%02d ",
sprintf(buf, "Locked for %2d:%02d ",
(int)seconds/60, (int)seconds%60);
XDrawImageString(dpy, XtWindow(widget), gc,

View File

@@ -92,7 +92,7 @@ getopt(nargc, nargv, ostr)
p = *nargv;
else
++p;
(void)fprintf(stderr, "%s: illegal option -- %c\n",
fprintf(stderr, "%s: illegal option -- %c\n",
p, optopt);
}
return(BADCH);
@@ -114,7 +114,7 @@ getopt(nargc, nargv, ostr)
if (*ostr == ':')
return(BADARG);
if (opterr)
(void)fprintf(stderr,
fprintf(stderr,
"%s: option requires an argument -- %c\n",
p, optopt);
return(BADCH);

View File

@@ -124,16 +124,16 @@ initshells()
if ((fp = fopen(_PATH_SHELLS, "r")) == NULL)
return (okshells);
if (fstat(fileno(fp), &statb) == -1) {
(void)fclose(fp);
fclose(fp);
return (okshells);
}
if ((strings = malloc((u_int)statb.st_size)) == NULL) {
(void)fclose(fp);
fclose(fp);
return (okshells);
}
shells = calloc((unsigned)statb.st_size / 3, sizeof (char *));
if (shells == NULL) {
(void)fclose(fp);
fclose(fp);
free(strings);
strings = NULL;
return (okshells);
@@ -151,7 +151,7 @@ initshells()
*cp++ = '\0';
}
*sp = NULL;
(void)fclose(fp);
fclose(fp);
return (shells);
}
#endif /* HAVE_GETUSERSHELL */

View File

@@ -817,15 +817,15 @@ qprintf(const Char *str, Char *s)
{
Char *p;
(void)printf("%s:\n", str);
printf("%s:\n", str);
for (p = s; *p; p++)
(void)printf("%c", CHAR(*p));
(void)printf("\n");
printf("%c", CHAR(*p));
printf("\n");
for (p = s; *p; p++)
(void)printf("%c", *p & M_PROTECT ? '"' : ' ');
(void)printf("\n");
printf("%c", *p & M_PROTECT ? '"' : ' ');
printf("\n");
for (p = s; *p; p++)
(void)printf("%c", ismeta(*p) ? '_' : ' ');
(void)printf("\n");
printf("%c", ismeta(*p) ? '_' : ' ');
printf("\n");
}
#endif

View File

@@ -223,17 +223,17 @@ iruserok(u_int32_t raddr, int superuser, const char *ruser, const char *luser)
again:
if (hostf) {
if (__ivaliduser(hostf, raddr, luser, ruser) == 0) {
(void)fclose(hostf);
fclose(hostf);
return (0);
}
(void)fclose(hostf);
fclose(hostf);
}
if (first == 1 && (__check_rhosts_file || superuser)) {
first = 0;
if ((pwd = k_getpwnam((char*)luser)) == NULL)
return (-1);
(void)strcpy(pbuf, pwd->pw_dir);
(void)strcat(pbuf, "/.rhosts");
strcpy(pbuf, pwd->pw_dir);
strcat(pbuf, "/.rhosts");
/*
* Change effective uid while opening .rhosts. If root and
@@ -241,9 +241,9 @@ again:
* are protected read/write owner only.
*/
uid = geteuid();
(void)seteuid(pwd->pw_uid);
seteuid(pwd->pw_uid);
hostf = fopen(pbuf, "r");
(void)seteuid(uid);
seteuid(uid);
if (hostf == NULL)
return (-1);
@@ -265,7 +265,7 @@ again:
/* If there were any problems, quit. */
if (cp) {
__rcmd_errstr = cp;
(void)fclose(hostf);
fclose(hostf);
return (-1);
}
goto again;