From 7a4573a55ad244b66c40b4086e432775b6f185b7 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 5 Feb 2018 12:42:59 +0100 Subject: [PATCH] Improve conversion loop --- win32/ioutil.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/win32/ioutil.h b/win32/ioutil.h index 41773b306e..c413b78b2a 100644 --- a/win32/ioutil.h +++ b/win32/ioutil.h @@ -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 = 0; + int err = 0, i; PHP_WIN32_IOUTIL_INIT_W(patha) if (!pathw) { @@ -386,9 +386,8 @@ __forceinline static FILE *php_win32_ioutil_fopen(const char *patha, const char PHP_WIN32_IOUTIL_CHECK_PATH_W(pathw, NULL, 1) - while (i < (sizeof(modew)-1)/sizeof(wchar_t) && modea[i]) { + for (i = 0; i < (sizeof(modew)-1)/sizeof(wchar_t); i++) { modew[i] = (wchar_t)modea[i]; - i++; } ret = php_win32_ioutil_fopen_w(pathw, modew); -- 2.50.1