diff options
author | Anatol Belski <ab@php.net> | 2018-03-07 12:29:22 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-03-07 12:29:22 +0100 |
commit | 22857f1d89efe73ce5988f254da0cc304a6e8bb1 (patch) | |
tree | 040318e0a71784c06576978c5e4fba1acbadc332 /main/php_open_temporary_file.c | |
parent | 7780bfc7b37792ad251084a2125419147fb1d668 (diff) | |
parent | 281e2f8207120ed47f6fbce53cc48e0e1fa8cb1f (diff) | |
download | php-git-22857f1d89efe73ce5988f254da0cc304a6e8bb1.tar.gz |
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
Guard platform dependent code
Diffstat (limited to 'main/php_open_temporary_file.c')
-rw-r--r-- | main/php_open_temporary_file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c index 30c8539351..8961692c24 100644 --- a/main/php_open_temporary_file.c +++ b/main/php_open_temporary_file.c @@ -90,13 +90,13 @@ static int php_do_open_temporary_file(const char *path, const char *pfx, zend_string **opened_path_p) { - char *trailing_slash; #ifdef PHP_WIN32 char *opened_path = NULL; size_t opened_path_len; wchar_t *cwdw, *pfxw, pathw[MAXPATHLEN]; #else char opened_path[MAXPATHLEN]; + char *trailing_slash; #endif char cwd[MAXPATHLEN]; cwd_state new_state; @@ -132,13 +132,13 @@ static int php_do_open_temporary_file(const char *path, const char *pfx, zend_st return -1; } +#ifndef PHP_WIN32 if (IS_SLASH(new_state.cwd[new_state.cwd_length - 1])) { trailing_slash = ""; } else { trailing_slash = "/"; } -#ifndef PHP_WIN32 if (snprintf(opened_path, MAXPATHLEN, "%s%s%sXXXXXX", new_state.cwd, trailing_slash, pfx) >= MAXPATHLEN) { efree(new_state.cwd); return -1; |