diff --git a/lib/isc/include/isc/tm.h b/lib/isc/include/isc/tm.h index 43e2aa34dd..44b81480e4 100644 --- a/lib/isc/include/isc/tm.h +++ b/lib/isc/include/isc/tm.h @@ -20,9 +20,12 @@ /*! \file isc/tm.h * Provides portable conversion routines for struct tm. */ - #include +#include +#include + + ISC_LANG_BEGINDECLS time_t diff --git a/lib/isc/tm.c b/lib/isc/tm.c index 4f058a6c7c..9f19f0727c 100644 --- a/lib/isc/tm.c +++ b/lib/isc/tm.c @@ -55,6 +55,10 @@ #include #include #include +#include + +#include +#include /* * Portable conversion routines for struct tm, replacing @@ -145,7 +149,7 @@ isc_tm_timegm(struct tm *tm) { char * isc_tm_strptime(const char *buf, const char *fmt, struct tm *tm) { - char c; + char c, *ret; const char *bp; size_t len = 0; int alt_format, i, split_year = 0; @@ -157,8 +161,8 @@ isc_tm_strptime(const char *buf, const char *fmt, struct tm *tm) { alt_format = 0; /* Eat up white-space. */ - if (isspace(c)) { - while (isspace(*bp)) + if (isspace((int) c)) { + while (isspace((int) *bp)) bp++; fmt++; @@ -423,7 +427,7 @@ literal: case 'n': /* Any kind of white-space. */ case 't': LEGAL_ALT(0); - while (isspace(*bp)) + while (isspace((int) *bp)) bp++; break; @@ -436,5 +440,6 @@ literal: } /* LINTED functional specification */ - return ((char *)bp); + DE_CONST(bp, ret); + return (ret); }