Skip to content

Commit 248c857

Browse files
committed
Reuse delivered length
Fix length calculation
1 parent 14628f1 commit 248c857

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

win32/ioutil.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ __forceinline static ssize_t php_win32_ioutil_readlink(const char *path, char *b
774774
return ret;
775775
}
776776

777-
ret_buf = php_win32_ioutil_conv_w_to_any(retw, PHP_WIN32_CP_IGNORE_LEN, &ret_buf_len);
777+
ret_buf = php_win32_ioutil_conv_w_to_any(retw, ret, &ret_buf_len);
778778
if (!ret_buf || ret_buf_len >= buf_len || ret_buf_len >= MAXPATHLEN) {
779779
free(pathw);
780780
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
784784

785785
free(pathw);
786786

787-
return ret;
787+
return ret_buf_len;
788788
}/*}}}*/
789789

790790
#ifdef __cplusplus

0 commit comments

Comments
 (0)