From: Moriyoshi Koizumi Date: Wed, 23 Oct 2002 16:48:33 +0000 (+0000) Subject: MFH X-Git-Tag: php-4.3.0pre2~153 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cbc9256fc9ca9f3db7fdae19c0b9d6222735487d;p=php MFH --- diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 2243bc46ff..d325be628b 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -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; }