mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Revert "Improve conversion loop"
This reverts commit 7a4573a55a
.
Don't read over '\0'.
This commit is contained in:
parent
9794272f3e
commit
d7f65f30a0
1 changed files with 3 additions and 2 deletions
|
@ -376,7 +376,7 @@ __forceinline static FILE *php_win32_ioutil_fopen(const char *patha, const char
|
|||
{/*{{{*/
|
||||
FILE *ret;
|
||||
wchar_t modew[16] = {0};
|
||||
int err = 0, i;
|
||||
int err = 0, i = 0;
|
||||
|
||||
PHP_WIN32_IOUTIL_INIT_W(patha)
|
||||
if (!pathw) {
|
||||
|
@ -386,8 +386,9 @@ __forceinline static FILE *php_win32_ioutil_fopen(const char *patha, const char
|
|||
|
||||
PHP_WIN32_IOUTIL_CHECK_PATH_W(pathw, NULL, 1)
|
||||
|
||||
for (i = 0; i < (sizeof(modew)-1)/sizeof(wchar_t); i++) {
|
||||
while (i < (sizeof(modew)-1)/sizeof(wchar_t) && modea[i]) {
|
||||
modew[i] = (wchar_t)modea[i];
|
||||
i++;
|
||||
}
|
||||
|
||||
ret = php_win32_ioutil_fopen_w(pathw, modew);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue