summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/telnet/commands.c28
-rw-r--r--usr.bin/telnet/defines.h3
-rw-r--r--usr.bin/telnet/main.c5
-rw-r--r--usr.bin/telnet/network.c3
-rw-r--r--usr.bin/telnet/ring.c7
-rw-r--r--usr.bin/telnet/ring.h6
-rw-r--r--usr.bin/telnet/telnet.c7
7 files changed, 35 insertions, 24 deletions
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index edf9fd5af5b..112dc0f84fb 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commands.c,v 1.14 1998/05/15 01:26:09 art Exp $ */
+/* $OpenBSD: commands.c,v 1.15 1998/05/15 03:16:35 art Exp $ */
/* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */
/*
@@ -35,6 +35,7 @@
*/
#include "telnet_locl.h"
+#include <err.h>
#if defined(IPPROTO_IP) && defined(IP_TOS)
int tos = -1;
@@ -70,7 +71,7 @@ skey_calc(argc, argv)
if(argc != 3) {
printf("%s sequence challenge\n", argv[0]);
- return;
+ return 0;
}
switch(fork()) {
@@ -78,7 +79,7 @@ skey_calc(argc, argv)
execv(PATH_SKEY, argv);
exit (1);
case -1:
- perror("fork");
+ err(1, "fork");
break;
default:
(void) wait(&status);
@@ -148,7 +149,7 @@ makeargv()
* Todo: 1. Could take random integers (12, 0x12, 012, 0b1).
*/
- static
+ static char
special(s)
register char *s;
{
@@ -1403,7 +1404,7 @@ extern int shell();
#endif /* !defined(TN3270) */
/*VARARGS*/
- static
+ static int
bye(argc, argv)
int argc; /* Number of arguments */
char *argv[]; /* arguments */
@@ -1499,7 +1500,7 @@ getslc(name)
genget(name, (char **) SlcList, sizeof(struct slclist));
}
- static
+ static int
slccmd(argc, argv)
int argc;
char *argv[];
@@ -1584,6 +1585,7 @@ getenvcmd(name)
genget(name, (char **) EnvList, sizeof(struct envlist));
}
+ int
env_cmd(argc, argv)
int argc;
char *argv[];
@@ -1763,7 +1765,7 @@ env_unexport(var)
{
register struct env_lst *ep;
- if (ep = env_find(var))
+ if ((ep = env_find(var)) != NULL)
ep->export = 0;
}
@@ -1916,6 +1918,7 @@ auth_help()
return 0;
}
+ int
auth_cmd(argc, argv)
int argc;
char *argv[];
@@ -2097,7 +2100,7 @@ filestuff(fd)
* Print status about the connection.
*/
/*ARGSUSED*/
- static
+ static int
status(argc, argv)
int argc;
char *argv[];
@@ -2604,8 +2607,8 @@ tn(argc, argv)
user = getenv("USER");
if (user == NULL ||
- (pw = getpwnam(user)) && pw->pw_uid != getuid()) {
- if (pw = getpwuid(getuid()))
+ ((pw = getpwnam(user)) && pw->pw_uid != getuid())) {
+ if ((pw = getpwuid(getuid())) != NULL)
user = pw->pw_name;
else
user = NULL;
@@ -2817,7 +2820,7 @@ command(top, tbuf, cnt)
/*
* Help command.
*/
- static
+ static int
help(argc, argv)
int argc;
char *argv[];
@@ -2847,9 +2850,6 @@ help(argc, argv)
return 0;
}
-static char *rcname = 0;
-static char rcbuf[128];
-
#if defined(IP_OPTIONS) && defined(IPPROTO_IP)
/*
diff --git a/usr.bin/telnet/defines.h b/usr.bin/telnet/defines.h
index 0203991dd24..038efc0bb20 100644
--- a/usr.bin/telnet/defines.h
+++ b/usr.bin/telnet/defines.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: defines.h,v 1.3 1998/03/12 04:57:30 art Exp $ */
+/* $OpenBSD: defines.h,v 1.4 1998/05/15 03:16:37 art Exp $ */
/* $NetBSD: defines.h,v 1.5 1996/02/28 21:03:55 thorpej Exp $ */
/*
@@ -65,4 +65,5 @@
#define MODE_OUT8 0x8000 /* binary mode sans -opost */
+void upcase P((register char *));
diff --git a/usr.bin/telnet/main.c b/usr.bin/telnet/main.c
index 25d5067bf73..9a5ea700527 100644
--- a/usr.bin/telnet/main.c
+++ b/usr.bin/telnet/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.6 1998/04/07 20:01:10 art Exp $ */
+/* $OpenBSD: main.c,v 1.7 1998/05/15 03:16:38 art Exp $ */
/* $NetBSD: main.c,v 1.5 1996/02/28 21:04:05 thorpej Exp $ */
/*
@@ -109,7 +109,7 @@ usage()
* main. Parse arguments, invoke the protocol or command parser.
*/
-
+ int
main(argc, argv)
int argc;
char *argv[];
@@ -363,4 +363,5 @@ main(argc, argv)
#endif
command(1, 0, 0);
}
+ return 0;
}
diff --git a/usr.bin/telnet/network.c b/usr.bin/telnet/network.c
index 4d7ff6d56f0..70886f4fb48 100644
--- a/usr.bin/telnet/network.c
+++ b/usr.bin/telnet/network.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: network.c,v 1.5 1998/03/12 04:57:36 art Exp $ */
+/* $OpenBSD: network.c,v 1.6 1998/05/15 03:16:39 art Exp $ */
/* $NetBSD: network.c,v 1.5 1996/02/28 21:04:06 thorpej Exp $ */
/*
@@ -35,6 +35,7 @@
*/
#include "telnet_locl.h"
+#include <err.h>
Ring netoring, netiring;
unsigned char netobuf[2*BUFSIZ], netibuf[BUFSIZ];
diff --git a/usr.bin/telnet/ring.c b/usr.bin/telnet/ring.c
index 469ec1ea39d..d7538a0775c 100644
--- a/usr.bin/telnet/ring.c
+++ b/usr.bin/telnet/ring.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ring.c,v 1.3 1998/03/12 04:57:38 art Exp $ */
+/* $OpenBSD: ring.c,v 1.4 1998/05/15 03:16:40 art Exp $ */
/* $NetBSD: ring.c,v 1.7 1996/02/28 21:04:07 thorpej Exp $ */
/*
@@ -84,8 +84,9 @@ static u_long ring_clock = 0;
/* Buffer state transition routines */
- ring_init(ring, buffer, count)
-Ring *ring;
+ int
+ring_init(ring, buffer, count)
+ Ring *ring;
unsigned char *buffer;
int count;
{
diff --git a/usr.bin/telnet/ring.h b/usr.bin/telnet/ring.h
index a512ef968ab..97ff777fabf 100644
--- a/usr.bin/telnet/ring.h
+++ b/usr.bin/telnet/ring.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ring.h,v 1.3 1998/03/12 04:57:39 art Exp $ */
+/* $OpenBSD: ring.h,v 1.4 1998/05/15 03:16:42 art Exp $ */
/* $NetBSD: ring.h,v 1.5 1996/02/28 21:04:09 thorpej Exp $ */
/*
@@ -100,3 +100,7 @@ extern void
extern void
ring_clear_mark P((Ring *)),
ring_mark P((Ring *));
+
+
+extern int
+ ring_at_mark P((Ring *));
diff --git a/usr.bin/telnet/telnet.c b/usr.bin/telnet/telnet.c
index 4da88cb6d39..379192f9e55 100644
--- a/usr.bin/telnet/telnet.c
+++ b/usr.bin/telnet/telnet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: telnet.c,v 1.4 1998/03/12 04:57:43 art Exp $ */
+/* $OpenBSD: telnet.c,v 1.5 1998/05/15 03:16:43 art Exp $ */
/* $NetBSD: telnet.c,v 1.7 1996/02/28 21:04:15 thorpej Exp $ */
/*
@@ -35,6 +35,7 @@
*/
#include "telnet_locl.h"
+#include <term.h>
#define strip(x) (eight ? (x) : ((x) & 0x7f))
@@ -537,6 +538,8 @@ dontoption(option)
* duplicate, or verbose names (names with spaces).
*/
+int is_unique P((char *, char **, char **));
+
static char *name_unknown = "UNKNOWN";
static char *unknown[] = { 0, 0 };
@@ -779,7 +782,7 @@ suboption()
TerminalSpeeds(&ispeed, &ospeed);
snprintf((char *)temp, sizeof(temp),
- "%c%c%c%c%d,%d%c%c", IAC, SB, TELOPT_TSPEED,
+ "%c%c%c%c%ld,%ld%c%c", IAC, SB, TELOPT_TSPEED,
TELQUAL_IS, ospeed, ispeed, IAC, SE);
len = strlen((char *)temp+4) + 4; /* temp[3] is 0 ... */