From f0cefaccaebc4ae564d923d644eaf64b2a048ce0 Mon Sep 17 00:00:00 2001 From: Dmitrij Tejblum Date: Sat, 12 Sep 1998 21:13:29 +0000 Subject: [PATCH] Change return type of strptime from const char* to char*. const char* was wrong and nonstandard. --- include/time.h | 2 +- lib/libc/stdtime/strptime.3 | 4 ++-- lib/libc/stdtime/strptime.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/time.h b/include/time.h index 1c63cf6dc3fc..58409776ff18 100644 --- a/include/time.h +++ b/include/time.h @@ -143,7 +143,7 @@ void tzset __P((void)); #endif /* not ANSI */ #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) -const char *strptime __P((const char *, const char *, struct tm *)); +char *strptime __P((const char *, const char *, struct tm *)); char *timezone __P((int, int)); void tzsetwall __P((void)); time_t timelocal __P((struct tm * const)); diff --git a/lib/libc/stdtime/strptime.3 b/lib/libc/stdtime/strptime.3 index bdda0e348cd1..ac1057260f9a 100644 --- a/lib/libc/stdtime/strptime.3 +++ b/lib/libc/stdtime/strptime.3 @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id$ +.\" $Id: strptime.3,v 1.1 1997/08/09 15:43:54 joerg Exp $ .\" " .Dd May 8, 1997 .Dt STRPTIME 3 @@ -33,7 +33,7 @@ .Nd parse date and time string .Sh SYNOPSIS .Fd #include -.Ft const char * +.Ft char * .Fn strptime "const char *buf" "const char *format" "struct tm *timeptr" .Sh DESCRIPTION The diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c index 1158b254b950..4c71eaab74c4 100644 --- a/lib/libc/stdtime/strptime.c +++ b/lib/libc/stdtime/strptime.c @@ -53,7 +53,7 @@ #ifdef LIBC_RCS static const char rcsid[] = - "$Id: strptime.c,v 1.2 1997/08/09 15:43:56 joerg Exp $"; + "$Id: strptime.c,v 1.3 1997/08/13 13:11:53 ache Exp $"; #endif #ifndef lint @@ -71,7 +71,7 @@ static char sccsid[] = "@(#)strptime.c 0.1 (Powerdog) 94/03/27"; #define asizeof(a) (sizeof (a) / sizeof ((a)[0])) -const char * +char * strptime(const char *buf, const char *fmt, struct tm *tm) { char c; @@ -345,5 +345,5 @@ strptime(const char *buf, const char *fmt, struct tm *tm) } } - return buf; + return (char *)buf; }