diff --git a/usr.bin/telnet/authenc.c b/usr.bin/telnet/authenc.c index 594885384889..3a974114a26c 100644 --- a/usr.bin/telnet/authenc.c +++ b/usr.bin/telnet/authenc.c @@ -1,4 +1,4 @@ -/* $NetBSD: authenc.c,v 1.6 1998/02/27 10:44:12 christos Exp $ */ +/* $NetBSD: authenc.c,v 1.7 1998/11/06 19:54:18 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)authenc.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: authenc.c,v 1.6 1998/02/27 10:44:12 christos Exp $"); +__RCSID("$NetBSD: authenc.c,v 1.7 1998/11/06 19:54:18 christos Exp $"); #endif #endif /* not lint */ @@ -93,7 +93,6 @@ telnet_gets(prompt, result, length, echo) int length; int echo; { - extern char *getpass(); extern int globalmode; int om = globalmode; char *res; @@ -102,7 +101,7 @@ telnet_gets(prompt, result, length, echo) if (echo) { printf("%s", prompt); res = fgets(result, length, stdin); - } else if (res = getpass(prompt)) { + } else if ((res = getpass(prompt)) != NULL) { strncpy(result, res, length); res = result; } diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c index 2f23736b8833..90387e7b4c23 100644 --- a/usr.bin/telnet/commands.c +++ b/usr.bin/telnet/commands.c @@ -1,4 +1,4 @@ -/* $NetBSD: commands.c,v 1.24 1998/07/26 22:35:48 mycroft Exp $ */ +/* $NetBSD: commands.c,v 1.25 1998/11/06 19:54:18 christos Exp $ */ /* * Copyright (c) 1988, 1990, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)commands.c 8.4 (Berkeley) 5/30/95"; #else -__RCSID("$NetBSD: commands.c,v 1.24 1998/07/26 22:35:48 mycroft Exp $"); +__RCSID("$NetBSD: commands.c,v 1.25 1998/11/06 19:54:18 christos Exp $"); #endif #endif /* not lint */ @@ -154,7 +154,7 @@ static int slccmd P((int, char *[])); static struct env_lst *env_help P((unsigned char *, unsigned char *)); static struct envlist *getenvcmd P((char *)); #ifdef AUTHENTICATION -static int auth_help P((void)); +static int auth_help P((char *)); #endif #if defined(unix) && defined(TN3270) static void filestuff P((int)); @@ -181,7 +181,7 @@ makeargv() } while ((c = *cp) != '\0') { register int inquote = 0; - while (isspace(c)) + while (isspace((unsigned char)c)) c = *++cp; if (c == '\0') break; @@ -203,7 +203,7 @@ makeargv() } else if (c == '\'') { inquote = '\''; continue; - } else if (isspace(c)) + } else if (isspace((unsigned char)c)) break; } *cp2++ = c; @@ -695,11 +695,13 @@ static struct togglelist Togglelist[] = { 0, &autologin, "send login name and/or authentication information" }, +#if 0 { "authdebug", "Toggle authentication debugging", auth_togdebug, 0, "print authentication debugging information" }, +#endif #endif { "skiprc", "don't read ~/.telnetrc file", @@ -1944,17 +1946,10 @@ unknown: struct authlist { char *name; char *help; - int (*handler)(); + int (*handler) P((char *)); int narg; }; -extern int - auth_enable P((char *)), - auth_disable P((char *)), - auth_status P((void)); -static int - auth_help P((void)); - struct authlist AuthList[] = { { "status", "Display current status of authentication information", auth_status, 0 }, @@ -1968,7 +1963,8 @@ struct authlist AuthList[] = { }; static int -auth_help() +auth_help(s) + char *s; { struct authlist *c; @@ -1983,6 +1979,7 @@ auth_help() return 0; } + int auth_cmd(argc, argv) int argc; char *argv[]; @@ -2014,7 +2011,7 @@ auth_cmd(argc, argv) c->narg, c->narg == 1 ? "" : "s", c->name); return 0; } - return((*c->handler)(argv[2], argv[3])); + return((*c->handler)(argv[2])); } #endif @@ -2644,11 +2641,11 @@ cmdrc(m1, m2) if (line[0] == '#') continue; if (gotmachine) { - if (!isspace(line[0])) + if (!isspace((unsigned char)line[0])) gotmachine = 0; } if (gotmachine == 0) { - if (isspace(line[0])) + if (isspace((unsigned char)line[0])) continue; if (strncasecmp(line, m1, l1) == 0) strncpy(line, &line[l1], sizeof(line) - l1); diff --git a/usr.bin/telnet/externs.h b/usr.bin/telnet/externs.h index 484e7c255eb5..b79f52af5edc 100644 --- a/usr.bin/telnet/externs.h +++ b/usr.bin/telnet/externs.h @@ -1,4 +1,4 @@ -/* $NetBSD: externs.h,v 1.11 1998/07/26 22:35:48 mycroft Exp $ */ +/* $NetBSD: externs.h,v 1.12 1998/11/06 19:54:19 christos Exp $ */ /* * Copyright (c) 1988, 1990, 1993 @@ -42,7 +42,7 @@ /* * ucb stdio.h defines BSD as something wierd */ -#if defined(sun) && defined(__svr4__) +#if defined(sun) && defined(__svr4__) && !defined(BSD) #define BSD 43 #endif @@ -314,7 +314,7 @@ void willoption P((int)); void wontoption P((int)); char **mklist P((char *, char *)); int is_unique P((char *, char **, char **)); -int setupterm P((char *, int, int *)); +int setup_term P((char *, int, int *)); char *gettermname P((void)); void lm_will P((unsigned char *, int)); void lm_wont P((unsigned char *, int)); diff --git a/usr.bin/telnet/telnet.c b/usr.bin/telnet/telnet.c index 6c053262face..8e6ea96b17da 100644 --- a/usr.bin/telnet/telnet.c +++ b/usr.bin/telnet/telnet.c @@ -1,4 +1,4 @@ -/* $NetBSD: telnet.c,v 1.11 1998/07/26 22:35:49 mycroft Exp $ */ +/* $NetBSD: telnet.c,v 1.12 1998/11/06 19:54:19 christos Exp $ */ /* * Copyright (c) 1988, 1990, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)telnet.c 8.4 (Berkeley) 5/30/95"; #else -__RCSID("$NetBSD: telnet.c,v 1.11 1998/07/26 22:35:49 mycroft Exp $"); +__RCSID("$NetBSD: telnet.c,v 1.12 1998/11/06 19:54:19 christos Exp $"); #endif #endif /* not lint */ @@ -692,7 +692,7 @@ mklist(buf, name) */ if ((c == ' ') || !isascii(c)) n = 1; - else if (islower(c)) + else if (islower((unsigned char)c)) *cp = toupper(c); } @@ -751,7 +751,7 @@ char termbuf[1024]; /*ARGSUSED*/ int -setupterm(tname, fd, errp) +setup_term(tname, fd, errp) char *tname; int fd, *errp; { @@ -785,7 +785,7 @@ gettermname() if (tnamep && tnamep != unknown) free(tnamep); if ((tname = (char *)env_getvalue((unsigned char *)"TERM")) && - (setupterm(tname, 1, &err) == 0)) { + (setup_term(tname, 1, &err) == 0)) { tnamep = mklist(termbuf, tname); } else { if (tname && ((int)strlen(tname) <= 40)) {