From 05a6f1f89e91e7d3c78381dd46afb5bf9652b158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Thu, 29 Jan 1998 22:13:47 +0100 Subject: [PATCH] Fix for ctime(). Rev: src/builtin_functions.c:1.59 --- src/builtin_functions.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/builtin_functions.c b/src/builtin_functions.c index 49e348a9f5..18129a4c0f 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: builtin_functions.c,v 1.58 1997/11/17 03:23:14 hubbe Exp $"); +RCSID("$Id: builtin_functions.c,v 1.59 1998/01/29 21:13:47 grubba Exp $"); #include "interpret.h" #include "svalue.h" #include "pike_macros.h" @@ -109,14 +109,15 @@ void f_copy_value(INT32 args) void f_ctime(INT32 args) { - INT32 i; + time_t i; + if(!args) error("Too few arguments to ctime()\n"); if(sp[-args].type != T_INT) error("Bad argument 1 to ctime()\n"); - i=sp[-args].u.integer; + i=(time_t)sp[-args].u.integer; pop_n_elems(args); - push_string(make_shared_string(ctime((time_t *)&i))); + push_string(make_shared_string(ctime(&i))); } void f_lower_case(INT32 args) -- GitLab