diff options
author | Anatol Belski <ab@php.net> | 2017-07-09 15:31:05 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2017-07-09 15:31:05 +0200 |
commit | 84079f4a1ef4c3c10ef81da33e75949ca8ab8347 (patch) | |
tree | b1e9488d1009f1b2a5bc344c9fd1413ba3eb7d18 /win32 | |
parent | e403acc74b63d051ce8fd62f081c1302a720a590 (diff) | |
download | php-git-84079f4a1ef4c3c10ef81da33e75949ca8ab8347.tar.gz |
cleanup casts
Diffstat (limited to 'win32')
-rw-r--r-- | win32/winutil.c | 4 | ||||
-rw-r--r-- | win32/winutil.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/win32/winutil.c b/win32/winutil.c index 2852a19e30..34dda95498 100644 --- a/win32/winutil.c +++ b/win32/winutil.c @@ -36,9 +36,9 @@ PHP_WINUTIL_API char *php_win32_error_to_msg(HRESULT error) return (buf ? (char *) buf : ""); }/*}}}*/ -int php_win32_check_trailing_space(const char * path, const int path_len) +int php_win32_check_trailing_space(const char * path, const size_t path_len) {/*{{{*/ - if (path_len < 1) { + if (path_len > MAXPATHLEN - 1) { return 1; } if (path) { diff --git a/win32/winutil.h b/win32/winutil.h index d4d3700f20..a08cdbef5a 100644 --- a/win32/winutil.h +++ b/win32/winutil.h @@ -28,7 +28,7 @@ PHP_WINUTIL_API char *php_win32_error_to_msg(HRESULT error); #define php_win_err() php_win32_error_to_msg(GetLastError()) -int php_win32_check_trailing_space(const char * path, const int path_len); +int php_win32_check_trailing_space(const char * path, const size_t path_len); PHP_WINUTIL_API int php_win32_get_random_bytes(unsigned char *buf, size_t size); #ifdef PHP_EXPORTS BOOL php_win32_init_random_bytes(void); |