Minor cleanup.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@223 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -24,9 +24,7 @@ SOURCES=auth.c encrypt.c genget.c \
|
|||||||
strchr.c strdup.c strerror.c strftime.c strrchr.c
|
strchr.c strdup.c strerror.c strftime.c strrchr.c
|
||||||
|
|
||||||
|
|
||||||
OBJECTS=auth.o encrypt.o genget.o \
|
OBJECTS=auth.o encrypt.o genget.o enc_des.o misc.o kerberos.o read_password.o \
|
||||||
misc.o kerberos.o kerberos5.o forward.o spx.o enc_des.o \
|
|
||||||
rsaencpwd.o krb4encpwd.o read_password.o \
|
|
||||||
$(LIBOBJS)
|
$(LIBOBJS)
|
||||||
|
|
||||||
all: libtelnet.a
|
all: libtelnet.a
|
||||||
|
@@ -31,26 +31,13 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#ifdef HAVE_CONFIG_H
|
||||||
static char sccsid[] = "@(#)strftime.c 8.1 (Berkeley) 6/4/93";
|
#include <config.h>
|
||||||
#endif /* LIBC_SCCS and not lint */
|
|
||||||
|
|
||||||
#ifndef __STDC__
|
|
||||||
#define const
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#ifdef notdef
|
|
||||||
#include <tzfile.h>
|
|
||||||
#else
|
|
||||||
#define TM_YEAR_BASE 1900 /* from <tzfile.h> */
|
#define TM_YEAR_BASE 1900 /* from <tzfile.h> */
|
||||||
#endif
|
|
||||||
#ifdef NO_STRING_H
|
|
||||||
#include <strings.h>
|
|
||||||
#else
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
static char *afmt[] = {
|
static char *afmt[] = {
|
||||||
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
|
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
|
||||||
@@ -75,17 +62,13 @@ static char *pt;
|
|||||||
#endif
|
#endif
|
||||||
static int _add __P((char *));
|
static int _add __P((char *));
|
||||||
static int _conv __P((int, int, int));
|
static int _conv __P((int, int, int));
|
||||||
#ifndef NO_MKTIME
|
#ifdef HAVE_MKTIME
|
||||||
static int _secs __P((const struct tm *));
|
static int _secs __P((const struct tm *));
|
||||||
#endif /* NO_MKTIME */
|
#endif /* HAVE_MKTIME */
|
||||||
static size_t _fmt __P((const char *, const struct tm *));
|
static size_t _fmt __P((const char *, const struct tm *));
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
strftime(s, maxsize, format, t)
|
strftime(char *s, size_t maxsize, const char *format, const struct tm *t)
|
||||||
char *s;
|
|
||||||
size_t maxsize;
|
|
||||||
const char *format;
|
|
||||||
const struct tm *t;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
pt = s;
|
pt = s;
|
||||||
@@ -99,9 +82,7 @@ strftime(s, maxsize, format, t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static size_t
|
static size_t
|
||||||
_fmt(format, t)
|
_fmt(const char *format, const struct tm *t)
|
||||||
register const char *format;
|
|
||||||
const struct tm *t;
|
|
||||||
{
|
{
|
||||||
for (; *format; ++format) {
|
for (; *format; ++format) {
|
||||||
if (*format == '%')
|
if (*format == '%')
|
||||||
@@ -204,12 +185,12 @@ _fmt(format, t)
|
|||||||
if (!_conv(t->tm_sec, 2, '0'))
|
if (!_conv(t->tm_sec, 2, '0'))
|
||||||
return(0);
|
return(0);
|
||||||
continue;
|
continue;
|
||||||
#ifndef NO_MKTIME
|
#ifdef HAVE_MKTIME
|
||||||
case 's':
|
case 's':
|
||||||
if (!_secs(t))
|
if (!_secs(t))
|
||||||
return(0);
|
return(0);
|
||||||
continue;
|
continue;
|
||||||
#endif /* NO_MKTIME */
|
#endif /* HAVE_MKTIME */
|
||||||
case 'T':
|
case 'T':
|
||||||
case 'X':
|
case 'X':
|
||||||
if (!_fmt("%H:%M:%S", t))
|
if (!_fmt("%H:%M:%S", t))
|
||||||
@@ -269,10 +250,9 @@ _fmt(format, t)
|
|||||||
return(gsize);
|
return(gsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_MKTIME
|
#ifdef HAVE_MKTIME
|
||||||
static int
|
static int
|
||||||
_secs(t)
|
_secs(const struct tm *t)
|
||||||
const struct tm *t;
|
|
||||||
{
|
{
|
||||||
static char buf[15];
|
static char buf[15];
|
||||||
register time_t s;
|
register time_t s;
|
||||||
@@ -286,11 +266,10 @@ _secs(t)
|
|||||||
*p-- = s % 10 + '0';
|
*p-- = s % 10 + '0';
|
||||||
return(_add(++p));
|
return(_add(++p));
|
||||||
}
|
}
|
||||||
#endif /* NO_MKTIME */
|
#endif /* HAVE_MKTIME */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_conv(n, digits, pad)
|
_conv(int n, int digits, int pad)
|
||||||
int n, digits, pad;
|
|
||||||
{
|
{
|
||||||
static char buf[10];
|
static char buf[10];
|
||||||
register char *p;
|
register char *p;
|
||||||
|
Reference in New Issue
Block a user