From: Antony Dovgal Date: Fri, 9 Jan 2009 22:50:45 +0000 (+0000) Subject: use temp var instead of wrong typecast X-Git-Tag: php-5.4.0alpha1~191^2~4573 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae66becc2badfebab09a9964aa2a10da9fbe597b;p=php use temp var instead of wrong typecast --- diff --git a/ext/standard/file.c b/ext/standard/file.c index 80dfde8cbd..1c744a396e 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -911,7 +911,7 @@ PHP_FUNCTION(tempnam) { zval **ppdir, **ppprefix; char *dir, *prefix; - int dir_len; + int dir_len, tmp_prefix_len; char *opened_path; char *p; int fd; @@ -922,7 +922,7 @@ PHP_FUNCTION(tempnam) } if (php_stream_path_param_encode(ppdir, &dir, &dir_len, REPORT_ERRORS, FG(default_context)) == FAILURE || - php_stream_path_param_encode(ppprefix, &prefix, (int *)&prefix_len, REPORT_ERRORS, FG(default_context)) == FAILURE) { + php_stream_path_param_encode(ppprefix, &prefix, &tmp_prefix_len, REPORT_ERRORS, FG(default_context)) == FAILURE) { RETURN_FALSE; } @@ -930,6 +930,7 @@ PHP_FUNCTION(tempnam) RETURN_FALSE; } + prefix_len = tmp_prefix_len; php_basename(prefix, prefix_len, NULL, 0, &p, &p_len TSRMLS_CC); if (p_len > 64) { p[63] = '\0';