From 07e361458a81ad3e6d27f0966fb2ab131f5e5cbf Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Tue, 28 Mar 2006 09:46:35 +0000 Subject: [PATCH] fix build and #36887 --- ext/standard/file.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/standard/file.c b/ext/standard/file.c index c85fbd8aba..844e8f0712 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -554,7 +554,6 @@ PHP_FUNCTION(tempnam) char *opened_path; char *p; FILE *fp; - size_t p_len; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; @@ -568,8 +567,8 @@ PHP_FUNCTION(tempnam) d = estrndup(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1)); - php_basename(Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2), NULL, 0, &p, &p_len TSRMLS_CC); - if (p_len > 64) { + p = php_basename(Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2), NULL, 0); + if (strlen(p) > 64) { p[63] = '\0'; } -- 2.40.0