]> granicus.if.org Git - php/commitdiff
Reuse delivered length
authorAnatol Belski <ab@php.net>
Wed, 3 Oct 2018 21:10:30 +0000 (23:10 +0200)
committerAnatol Belski <ab@php.net>
Wed, 3 Oct 2018 21:12:49 +0000 (23:12 +0200)
Fix length calculation

win32/ioutil.h

index db21c449e0f16b381cf7856c88db8e8dbbf66def..e49b1050a005856232e0f4ed9794967105cea687 100644 (file)
@@ -774,7 +774,7 @@ __forceinline static ssize_t php_win32_ioutil_readlink(const char *path, char *b
                return ret;
        }
 
-       ret_buf = php_win32_ioutil_conv_w_to_any(retw, PHP_WIN32_CP_IGNORE_LEN, &ret_buf_len);
+       ret_buf = php_win32_ioutil_conv_w_to_any(retw, ret, &ret_buf_len);
        if (!ret_buf || ret_buf_len >= buf_len || ret_buf_len >= MAXPATHLEN) {
                free(pathw);
                SET_ERRNO_FROM_WIN32_CODE(ERROR_BAD_PATHNAME);
@@ -784,7 +784,7 @@ __forceinline static ssize_t php_win32_ioutil_readlink(const char *path, char *b
 
        free(pathw);
 
-       return ret;
+       return ret_buf_len;
 }/*}}}*/
 
 #ifdef __cplusplus