}
#ifdef PHP_WIN32
- if (!php_win32_check_trailing_space(pfx, (const int)strlen(pfx))) {
+ if (!php_win32_check_trailing_space(pfx, strlen(pfx))) {
SetLastError(ERROR_INVALID_NAME);
return -1;
}
}
#ifdef PHP_WIN32
- if (!php_win32_check_trailing_space(url_from, (int)strlen(url_from))) {
+ if (!php_win32_check_trailing_space(url_from, strlen(url_from))) {
php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to);
return 0;
}
- if (!php_win32_check_trailing_space(url_to, (int)strlen(url_to))) {
+ if (!php_win32_check_trailing_space(url_to, strlen(url_to))) {
php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to);
return 0;
}
}
#ifdef PHP_WIN32
- if (!php_win32_check_trailing_space(url, (int)strlen(url))) {
+ if (!php_win32_check_trailing_space(url, strlen(url))) {
php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT));
return 0;
}
#endif
mode_t mode;
int ret = 0;
-#ifdef PHP_WIN32
- int url_len = (int)strlen(url);
-#endif
#ifdef PHP_WIN32
- if (!php_win32_check_trailing_space(url, url_len)) {
+ if (!php_win32_check_trailing_space(url, strlen(url))) {
php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT));
return 0;
}
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) {
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);