summaryrefslogtreecommitdiffstats
path: root/contrib/telnet/libtelnet/misc.c
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2001-11-30 21:06:38 +0000
committermarkm <markm@FreeBSD.org>2001-11-30 21:06:38 +0000
commit19fd256fae7c15fbb63128196d5550a72c559ea8 (patch)
tree1caab024c94078fe45902c1c2f8f58e5bdb7d4f4 /contrib/telnet/libtelnet/misc.c
parente92874bd103e4d5462fd2c0013b77afc3d52df05 (diff)
downloadFreeBSD-src-19fd256fae7c15fbb63128196d5550a72c559ea8.zip
FreeBSD-src-19fd256fae7c15fbb63128196d5550a72c559ea8.tar.gz
Very large style makeover.
1) ANSIfy. 2) Clean up ifdefs so that a) ones that never/always apply are appropriately either fully removed, or just the #if junk is removed. b) change #if defined(FOO) for appropiate values of FOO. (currently AUTHENTICATION and ENCRYPTION) 3) WARNS=2 fixing 4) GC other unused stuff This code can now be unifdef(1)ed to make non-crypto telnet.
Diffstat (limited to 'contrib/telnet/libtelnet/misc.c')
-rw-r--r--contrib/telnet/libtelnet/misc.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/contrib/telnet/libtelnet/misc.c b/contrib/telnet/libtelnet/misc.c
index c9ebec7..e9e7957 100644
--- a/contrib/telnet/libtelnet/misc.c
+++ b/contrib/telnet/libtelnet/misc.c
@@ -32,6 +32,7 @@
*/
#include <sys/cdefs.h>
+
__FBSDID("$FreeBSD$");
#ifndef lint
@@ -42,8 +43,10 @@ static const char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+
#include "misc.h"
-#if defined(AUTHENTICATION)
+#ifdef AUTHENTICATION
#include "auth.h"
#endif
#ifdef ENCRYPTION
@@ -55,16 +58,18 @@ char *LocalHostName;
char *UserNameRequested = 0;
int ConnectedCount = 0;
- void
-auth_encrypt_init(local, remote, name, server)
- char *local;
- char *remote;
- char *name;
- int server;
+#ifndef AUTHENTICATION
+#define undef1 __unused
+#else
+#define undef1
+#endif
+
+void
+auth_encrypt_init(char *local, char *remote, const char *name undef1, int server undef1)
{
RemoteHostName = remote;
LocalHostName = local;
-#if defined(AUTHENTICATION)
+#ifdef AUTHENTICATION
auth_init(name, server);
#endif
#ifdef ENCRYPTION
@@ -76,27 +81,23 @@ auth_encrypt_init(local, remote, name, server)
}
}
- void
-auth_encrypt_user(name)
- char *name;
+#ifdef ENCRYPTION
+void
+auth_encrypt_user(char *name)
{
- extern char *strdup();
-
if (UserNameRequested)
free(UserNameRequested);
UserNameRequested = name ? strdup(name) : 0;
}
- void
-auth_encrypt_connect(cnt)
- int cnt;
+void
+auth_encrypt_connect(int cnt __unused)
{
}
+#endif /* ENCRYPTION */
- void
-printd(data, cnt)
- unsigned char *data;
- int cnt;
+void
+printd(const unsigned char *data, int cnt)
{
if (cnt > 16)
cnt = 16;
OpenPOWER on IntegriCloud