From: Anatol Belski Date: Mon, 5 Feb 2018 11:42:59 +0000 (+0100) Subject: Improve conversion loop X-Git-Tag: php-7.3.0alpha1~468^2~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a4573a55ad244b66c40b4086e432775b6f185b7;p=php Improve conversion loop --- 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);