From: Antony Dovgal Date: Fri, 12 Aug 2005 23:21:29 +0000 (+0000) Subject: make valgrind and gcc happy X-Git-Tag: PRE_NEW_OCI8_EXTENSION~290 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6bd0350af8a749fb64ebef366edd7b86c1ce494c;p=php make valgrind and gcc happy --- diff --git a/main/streams/streams.c b/main/streams/streams.c index fd69a4b36f..c5ea06c7c1 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -2379,7 +2379,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int optio if (wrapper) { stream = wrapper->wops->stream_opener(wrapper, - path_to_open, implicit_mode, options ^ REPORT_ERRORS, + path_to_open, (char *)implicit_mode, options ^ REPORT_ERRORS, opened_path, context STREAMS_REL_CC TSRMLS_CC); /* if the caller asked for a persistent stream but the wrapper did not @@ -2441,7 +2441,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int optio } /* Output encoding on text mode streams defaults to utf8 unless specified in context parameter */ - if (stream && strchr(implicit_mode, 't') && (strchr(implicit_mode, 'w') || strchr(implicit_mode, 'a') || strchr(implicit_mode, '+'))) { + if (stream && memchr(implicit_mode, 't', modelen) && (memchr(implicit_mode, 'w', modelen) || memchr(implicit_mode, 'a', modelen) || memchr(implicit_mode, '+', modelen))) { php_stream_filter *filter; char *encoding = (context && context->output_encoding) ? context->output_encoding : "utf8"; char *filtername; @@ -2460,7 +2460,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int optio efree(filtername); } - if (stream && strchr(implicit_mode, 't') && (strchr(implicit_mode, 'r') || strchr(implicit_mode, '+'))) { + if (stream && memchr(implicit_mode, 't', modelen) && (memchr(implicit_mode, 'r', modelen) || memchr(implicit_mode, '+', modelen))) { php_stream_filter *filter; char *filtername; char *encoding = (context && context->input_encoding) ? context->input_encoding : "utf8";