diff options
Diffstat (limited to 'Zend/zend_alloc.c')
-rw-r--r-- | Zend/zend_alloc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 78a0a18542..79041ed263 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -409,6 +409,15 @@ ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) return p; } +#if !USE_ZEND_ALLOC +char *_strndup(char *s, uint l) +{ + char *tmp = malloc(l+1); + tmp[l] = '\0'; + memcpy(tmp, s, l); + return tmp; +} +#endif ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) { |