summaryrefslogtreecommitdiff
path: root/main/SAPI.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/SAPI.c')
-rw-r--r--main/SAPI.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index 60b886fd0a..95adcc9e68 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -247,8 +247,8 @@ SAPI_API size_t sapi_apply_default_charset(char **mimetype, size_t len SLS_DC)
if (*charset && strncmp(*mimetype, "text/", 5) == 0 && strstr(*mimetype, "charset=") == NULL) {
newlen = len + (sizeof(";charset=")-1) + strlen(charset);
newtype = emalloc(newlen + 1);
- strlcpy(newtype, *mimetype, len);
- strlcat(newtype, ";charset=", len);
+ PHP_STRLCPY(newtype, *mimetype, newlen + 1, len);
+ strlcat(newtype, ";charset=", newlen + 1);
if (*mimetype != NULL) {
efree(*mimetype);
}