]> granicus.if.org Git - php/commitdiff
make valgrind and gcc happy
authorAntony Dovgal <tony2001@php.net>
Fri, 12 Aug 2005 23:21:29 +0000 (23:21 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 12 Aug 2005 23:21:29 +0000 (23:21 +0000)
main/streams/streams.c

index fd69a4b36fabde0880a4f35e6af56b71ec3db1b9..c5ea06c7c17084b552944e6650d2a8981ccf3aa3 100755 (executable)
@@ -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";