diff options
author | Rasmus Lerdorf <rasmus@php.net> | 2002-08-03 14:09:56 +0000 |
---|---|---|
committer | Rasmus Lerdorf <rasmus@php.net> | 2002-08-03 14:09:56 +0000 |
commit | c8bf1652424328e712aaf5af6e3fee436458821d (patch) | |
tree | 672fbe324f0363db9b46716ad47574643fd8e58f /main/SAPI.c | |
parent | 02a12b57e95632ab6a4343f294fd3bbc93ae9d5f (diff) | |
download | php-git-c8bf1652424328e712aaf5af6e3fee436458821d.tar.gz |
Yup, sizeof() includes the space for the \0
Diffstat (limited to 'main/SAPI.c')
-rw-r--r-- | main/SAPI.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/SAPI.c b/main/SAPI.c index bc50b0388f..f03b858f56 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -220,7 +220,7 @@ SAPI_API char *sapi_get_default_content_type(TSRMLS_D) charset = SG(default_charset) ? SG(default_charset) : SAPI_DEFAULT_CHARSET; if (strncasecmp(mimetype, "text/", 5) == 0 && *charset) { - int len = strlen(mimetype) + sizeof("; charset=") + strlen(charset)+1; + int len = strlen(mimetype) + sizeof("; charset=") + strlen(charset); /* sizeof() includes \0 */ content_type = emalloc(len); snprintf(content_type, len, "%s; charset=%s", mimetype, charset); } else { |