com php-src: Sync with the POSIX signature: win32/ioutil.h
| From: | Anatol Belski | Date: | Tue, 28 Nov 2017 08:15:14 +0000 |
| Subject: | com php-src: Sync with the POSIX signature: win32/ioutil.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100399@lists.php.net to get a copy of this message | ||
Commit: e9927994eb66196fa26b65dcc1c30c03f01cf9a5
Author: Anatol Belski <ab@php.net> Mon, 27 Nov 2017 14:01:55 +0100
Parents: 3ce0de84d78f222944cd74b13590e3339dbf32cc
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e9927994eb66196fa26b65dcc1c30c03f01cf9a5
Log:
Sync with the POSIX signature
Changed paths:
M win32/ioutil.h
Diff:
diff --git a/win32/ioutil.h b/win32/ioutil.h
index a22ca3e..01e8e23 100644
--- a/win32/ioutil.h
+++ b/win32/ioutil.h
@@ -466,14 +466,14 @@ __forceinline static int php_win32_ioutil_chdir(const char *patha)
return ret;
}/*}}}*/
-__forceinline static char *php_win32_ioutil_getcwd(char *buf, int len)
+__forceinline static char *php_win32_ioutil_getcwd(char *buf, size_t len)
{/*{{{*/
wchar_t tmp_bufw[PHP_WIN32_IOUTIL_MAXPATHLEN];
char *tmp_bufa = NULL;
size_t tmp_bufa_len;
DWORD err = 0;
- if (php_win32_ioutil_getcwd_w(tmp_bufw, PHP_WIN32_IOUTIL_MAXPATHLEN) == NULL) {
+ if (php_win32_ioutil_getcwd_w(tmp_bufw, len) == NULL) {
err = GetLastError();
SET_ERRNO_FROM_WIN32_CODE(err);
return NULL;
@@ -494,7 +494,7 @@ __forceinline static char *php_win32_ioutil_getcwd(char *buf, int len)
/* If buf was NULL, the result has to be freed outside here. */
buf = tmp_bufa;
} else {
- if (tmp_bufa_len + 1 > (size_t)len) {
+ if (tmp_bufa_len + 1 > len) {
free(tmp_bufa);
SET_ERRNO_FROM_WIN32_CODE(ERROR_INSUFFICIENT_BUFFER);
return NULL;