diff options
| author | Sterling Hughes <sterling@php.net> | 2001-09-15 16:05:38 +0000 |
|---|---|---|
| committer | Sterling Hughes <sterling@php.net> | 2001-09-15 16:05:38 +0000 |
| commit | ca5fdbf5375bd2c68031386c83f9c31767631e97 (patch) | |
| tree | 6f4cc246ae0c72a1a1f7a2d60511a61c0b607fdc /ext/xslt/sablot.c | |
| parent | 236bcdb514684f7791241725fcb993135d44fc74 (diff) | |
| download | php-git-ca5fdbf5375bd2c68031386c83f9c31767631e97.tar.gz | |
fix this in a couple of other places and use estrndup() when we have the
string length.
Diffstat (limited to 'ext/xslt/sablot.c')
| -rw-r--r-- | ext/xslt/sablot.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/xslt/sablot.c b/ext/xslt/sablot.c index 26af287734..5bbe97f57a 100644 --- a/ext/xslt/sablot.c +++ b/ext/xslt/sablot.c @@ -1301,18 +1301,18 @@ static MH_ERROR error_log(void *user_data, SablotHandle proc, MH_ERROR code, MH_ key = emalloc(pos + 1); val = emalloc((len - pos) + 1); - strlcpy(key, *fields, pos); - strlcpy(val, *fields + pos + 1, len - pos - 1); + strlcpy(key, *fields, pos + 1); + strlcpy(val, *fields + pos + 1, len - pos); /* Check to see whether or not we want to save the data */ if (!strcmp(key, "msg")) { - errmsg = estrndup(val, len - pos -1); + errmsg = estrndup(val, len - pos); } else if (!strcmp(key, "type")) { - errtype = estrndup(val, len - pos - 1); + errtype = estrndup(val, len - pos); } else if (!strcmp(key, "line")) { - errline = estrndup(val, len - pos - 1); + errline = estrndup(val, len - pos); } /* Cleanup */ @@ -1449,8 +1449,8 @@ static MH_ERROR error_print(void *user_data, SablotHandle proc, MH_ERROR code, M key = emalloc(pos + 1); val = emalloc((len - pos) + 1); - strlcpy(key, *fields, pos); - strlcpy(val, *fields + pos + 1, len - pos - 1); + strlcpy(key, *fields, pos + 1); + strlcpy(val, *fields + pos + 1, len - pos); /* Add it */ add_assoc_stringl_ex(argv[3], key, pos, val, len - pos - 1, 1); @@ -1512,10 +1512,10 @@ static MH_ERROR error_print(void *user_data, SablotHandle proc, MH_ERROR code, M /* Check to see whether or not we want to save the data */ if (!strcmp(key, "msg")) { - errmsg = estrdup(val); + errmsg = estrndup(val, len - pos); } else if (!strcmp(key, "line")) { - errline = estrdup(val); + errline = estrndup(val, len - pos); } /* Cleanup */ |
