diff options
author | Andi Gutmans <andi@php.net> | 2001-03-12 16:23:19 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2001-03-12 16:23:19 +0000 |
commit | 123491aeac24fa1d221bed72ce12d126c87a9053 (patch) | |
tree | 16f950453375249b9b1a244b4809ef0389cf85d8 /Zend/zend_API.c | |
parent | 3118af8293e34032f3c4915dd4c3b5848c8f4e11 (diff) | |
download | php-git-123491aeac24fa1d221bed72ce12d126c87a9053.tar.gz |
- Nuke snprintf()
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index b743e0a58f..e7aa3ab946 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -955,8 +955,15 @@ zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callabl efree(lcname); if (found == FAILURE) { if (callable_name) { - callable_name_len = snprintf(name_buf, 1024, "%s::%s", Z_STRVAL_PP(obj), Z_STRVAL_PP(method)); - *callable_name = estrndup(name_buf, callable_name_len); + char *ptr; + + callable_name_len = Z_STRLEN_PP(obj) + Z_STRLEN_PP(method) + sizeof("::"); + ptr = *callable_name = emalloc(callable_name_len); + memcpy(ptr, Z_STRVAL_PP(obj), Z_STRLEN_PP(obj)); + ptr += Z_STRLEN_PP(obj); + memcpy(ptr, "::", sizeof("::") - 1); + ptr += sizeof("::") - 1; + memcpy(ptr, Z_STRVAL_PP(method), Z_STRLEN_PP(method) + 1); } break; } |