]> granicus.if.org Git - php/commitdiff
Avoid strlen()
authorIlia Alshanetsky <iliaa@php.net>
Sat, 19 May 2007 17:52:30 +0000 (17:52 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 19 May 2007 17:52:30 +0000 (17:52 +0000)
ext/iconv/iconv.c

index 398952a2c59e0a67e267f50e449829346c9013c1..3c2f447416dca79b0e3f88a02187173aa5c20c77 100644 (file)
@@ -2305,8 +2305,8 @@ PHP_FUNCTION(ob_iconv_handler)
                                ICONVG(output_encoding), ICONVG(internal_encoding));
                _php_iconv_show_error(err, ICONVG(output_encoding), ICONVG(internal_encoding) TSRMLS_CC);
                if (out_buffer != NULL) {
-                       spprintf(&content_type, 0, "Content-Type:%s; charset=%s", mimetype, ICONVG(output_encoding));
-                       if (content_type && sapi_add_header(content_type, strlen(content_type), 0) != FAILURE) {
+                       int len = spprintf(&content_type, 0, "Content-Type:%s; charset=%s", mimetype, ICONVG(output_encoding));
+                       if (content_type && sapi_add_header(content_type, len, 0) != FAILURE) {
                                SG(sapi_headers).send_default_content_type = 0;
                        }
                        if (mimetype_alloced) {