cvs: php4 /ext/standard filestat.c

From: Date: Mon, 13 May 2002 18:11:29 +0000
Subject: cvs: php4 /ext/standard filestat.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-11902@lists.php.net to get a copy of this message
rasmus Mon May 13 14:11:29 2002 EDT Modified files: /php4/ext/standard filestat.c Log: Make sure newtime is never NULL Index: php4/ext/standard/filestat.c diff -u php4/ext/standard/filestat.c:1.90 php4/ext/standard/filestat.c:1.91 --- php4/ext/standard/filestat.c:1.90 Fri Apr 26 19:46:51 2002 +++ php4/ext/standard/filestat.c Mon May 13 14:11:27 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filestat.c,v 1.90 2002/04/26 23:46:51 yohgaki Exp $ */ +/* $Id: filestat.c,v 1.91 2002/05/13 18:11:27 rasmus Exp $ */ #include "php.h" #include "safe_mode.h" @@ -478,17 +478,17 @@ struct utimbuf *newtime = NULL; int ac = ZEND_NUM_ARGS(); + newtime = &newtimebuf; + if (ac == 1 && zend_get_parameters_ex(1, &filename) != FAILURE) { #ifndef HAVE_UTIME_NULL newtime->modtime = newtime->actime = time(NULL); #endif } else if (ac == 2 && zend_get_parameters_ex(2, &filename, &filetime) != FAILURE) { - newtime = &newtimebuf; convert_to_long_ex(filetime); newtime->actime = time(NULL); newtime->modtime = newtime->actime = Z_LVAL_PP(filetime); } else if (ac == 3 && zend_get_parameters_ex(3, &filename, &filetime, &fileatime) != FAILURE) { - newtime = &newtimebuf; convert_to_long_ex(fileatime); convert_to_long_ex(filetime); newtime->actime = Z_LVAL_PP(fileatime);

« previous php.cvs (#11902) next »