aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/telnet/telnetd/utility.c
diff options
context:
space:
mode:
authorMark Murray <markm@FreeBSD.org>1997-09-07 07:02:53 +0000
committerMark Murray <markm@FreeBSD.org>1997-09-07 07:02:53 +0000
commit04c426cce3f772421256462aca04a85047d8ca76 (patch)
treeabbd550c611dca52b6fea6b12fe44b08a6fd48c6 /crypto/telnet/telnetd/utility.c
parentc109c5775a0dc072fd79cf731b48f2a56356f7cc (diff)
downloadsrc-04c426cce3f772421256462aca04a85047d8ca76.tar.gz
src-04c426cce3f772421256462aca04a85047d8ca76.zip
Bring the FreeBSD changes to the virgin sources.
Notes
Notes: svn path=/head/; revision=29181
Diffstat (limited to 'crypto/telnet/telnetd/utility.c')
-rw-r--r--crypto/telnet/telnetd/utility.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/crypto/telnet/telnetd/utility.c b/crypto/telnet/telnetd/utility.c
index 9553d58b9193..eac3b6905246 100644
--- a/crypto/telnet/telnetd/utility.c
+++ b/crypto/telnet/telnetd/utility.c
@@ -32,12 +32,22 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
+static const char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
#endif /* not lint */
+#ifdef __FreeBSD__
+#include <locale.h>
+#endif
#define PRINTOPTIONS
#include "telnetd.h"
+#if defined(AUTHENTICATION)
+#include <libtelnet/auth.h>
+#endif
+#if defined(ENCRYPTION)
+#include <libtelnet/encrypt.h>
+#endif
+
/*
* utility functions performing io related tasks
*/
@@ -93,6 +103,7 @@ stilloob(s)
do {
FD_ZERO(&excepts);
FD_SET(s, &excepts);
+ memset((char *)&timeout, 0, sizeof timeout);
value = select(s+1, (fd_set *)0, (fd_set *)0, &excepts, &timeout);
} while ((value == -1) && (errno == EINTR));
@@ -433,12 +444,16 @@ putchr(cc)
*putlocation++ = cc;
}
+#ifdef __FreeBSD__
+static char fmtstr[] = { "%+" };
+#else
/*
* This is split on two lines so that SCCS will not see the M
* between two % signs and expand it...
*/
static char fmtstr[] = { "%l:%M\
%P on %A, %d %B %Y" };
+#endif
void
putf(cp, where)
@@ -481,6 +496,9 @@ putf(cp, where)
break;
case 'd':
+#ifdef __FreeBSD__
+ setlocale(LC_TIME, "");
+#endif
(void)time(&t);
(void)strftime(db, sizeof(db), fmtstr, localtime(&t));
putstr(db);
@@ -939,7 +957,6 @@ printsub(direction, pointer, length)
break;
default:
- def_case:
if (isprint(pointer[i]) && pointer[i] != '"') {
if (noquote) {
*nfrontp++ = '"';
@@ -1110,12 +1127,12 @@ printsub(direction, pointer, length)
break;
case ENCRYPT_ENC_KEYID:
- sprintf(nfrontp, " ENC_KEYID", pointer[1]);
+ sprintf(nfrontp, " ENC_KEYID");
nfrontp += strlen(nfrontp);
goto encommon;
case ENCRYPT_DEC_KEYID:
- sprintf(nfrontp, " DEC_KEYID", pointer[1]);
+ sprintf(nfrontp, " DEC_KEYID");
nfrontp += strlen(nfrontp);
goto encommon;