PHPAPI int _php_stream_puts(php_stream *stream, const char *buf TSRMLS_DC)
{
- int len;
+ size_t len;
char newline[2] = "\n"; /* is this OK for Win? */
len = strlen(buf);
if (ret == PHP_STREAM_OPTION_RETURN_NOTIMPL) {
switch(option) {
case PHP_STREAM_OPTION_SET_CHUNK_SIZE:
- ret = stream->chunk_size;
+ /* XXX chunk size itself is of size_t, that might be ok or not for a particular case*/
+ ret = stream->chunk_size > INT_MAX ? INT_MAX : (int)stream->chunk_size;
stream->chunk_size = value;
return ret;
{
size_t bcount = 0;
char buf[8192];
- int b;
+ size_t b;
if (php_stream_mmap_possible(stream)) {
char *p;
/* API for registering GLOBAL wrappers */
PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrapper *wrapper TSRMLS_DC)
{
- unsigned int protocol_len = strlen(protocol);
+ unsigned int protocol_len = (unsigned int)strlen(protocol);
if (php_stream_wrapper_scheme_validate(protocol, protocol_len) == FAILURE) {
return FAILURE;
/* API for registering VOLATILE wrappers */
PHPAPI int php_register_url_stream_wrapper_volatile(const char *protocol, php_stream_wrapper *wrapper TSRMLS_DC)
{
- unsigned int protocol_len = strlen(protocol);
+ unsigned int protocol_len = (unsigned int)strlen(protocol);
if (php_stream_wrapper_scheme_validate(protocol, protocol_len) == FAILURE) {
return FAILURE;
}
if (options & USE_PATH) {
- resolved_path = zend_resolve_path(path, strlen(path) TSRMLS_CC);
+ resolved_path = zend_resolve_path(path, (int)strlen(path) TSRMLS_CC);
if (resolved_path) {
path = resolved_path;
/* we've found this file, don't re-check include_path or run realpath */