]> granicus.if.org Git - php/commitdiff
Improve conversion loop
authorAnatol Belski <ab@php.net>
Mon, 5 Feb 2018 11:42:59 +0000 (12:42 +0100)
committerAnatol Belski <ab@php.net>
Mon, 5 Feb 2018 19:42:17 +0000 (20:42 +0100)
win32/ioutil.h

index 41773b306ec3b8fa8cede449a975fe56e9fb81a2..c413b78b2a22f06f200adb341cad4994175ae6f0 100644 (file)
@@ -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);