]> granicus.if.org Git - php/commitdiff
MFH
authorMoriyoshi Koizumi <moriyoshi@php.net>
Wed, 23 Oct 2002 16:48:33 +0000 (16:48 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Wed, 23 Oct 2002 16:48:33 +0000 (16:48 +0000)
ext/mbstring/mbstring.c

index 2243bc46ffbc175f19661ff2a9c1cf1c6429d1df..d325be628bc34bae39386f4cf9676dffc225494c 100644 (file)
@@ -1856,12 +1856,7 @@ PHP_FUNCTION(mb_output_handler)
                if (SG(sapi_headers).send_default_content_type || send_text_mimetype) {
                        charset = mbfl_no2preferred_mime_name(encoding);
                        if (charset) {
-                               len = (sizeof ("Content-Type:")-1) + strlen(mimetype) + (sizeof (";charset=")-1) + strlen(charset) + 1;
-                               p = emalloc(len);
-                               strcpy(p, "Content-Type:");
-                               strcat(p, mimetype);
-                               strcat(p, ";charset=");
-                               strcat(p, charset);
+                               len = spprintf( &p, 0, "Content-Type: %s; charset=%s",  mimetype, charset ); 
                                if (sapi_add_header(p, len, 0) != FAILURE)
                                        SG(sapi_headers).send_default_content_type = 0;
                        }