mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Guard platform dependent code
This commit is contained in:
parent
8a57fcdfbd
commit
281e2f8207
1 changed files with 2 additions and 2 deletions
|
@ -97,13 +97,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;
|
||||
|
@ -139,13 +139,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue