@@ -134,6 +134,8 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
134
134
#include <string.h>
135
135
#undef _GNU_SOURCE
136
136
137
+ char * _strndup (char * s , uint l );
138
+
137
139
/* Standard wrapper macros */
138
140
#define emalloc (size ) malloc(size)
139
141
#define safe_emalloc (nmemb , size , offset ) malloc((nmemb) * (size) + (offset))
@@ -142,7 +144,7 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
142
144
#define erealloc (ptr , size ) realloc((ptr), (size))
143
145
#define erealloc_recoverable (ptr , size ) realloc((ptr), (size))
144
146
#define estrdup (s ) strdup(s)
145
- #define estrndup (s , length ) strndup ((s), (length))
147
+ #define estrndup (s , length ) _strndup ((s), (length))
146
148
147
149
/* Relay wrapper macros */
148
150
#define emalloc_rel (size ) malloc(size)
@@ -152,7 +154,7 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
152
154
#define erealloc_rel (ptr , size ) realloc((ptr), (size))
153
155
#define erealloc_recoverable_rel (ptr , size ) realloc((ptr), (size))
154
156
#define estrdup_rel (s ) strdup(s)
155
- #define estrndup_rel (s , length ) strndup ((s), (length))
157
+ #define estrndup_rel (s , length ) _strndup ((s), (length))
156
158
157
159
/* Selective persistent/non persistent allocation macros */
158
160
#define pemalloc (size , persistent ) malloc(size)
@@ -171,7 +173,7 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
171
173
#define pestrdup_rel (s , persistent ) strdup(s)
172
174
173
175
#define safe_estrdup (ptr ) ((ptr)?(strdup(ptr)):(empty_string))
174
- #define safe_estrndup (ptr , len ) ((ptr)?(strndup ((ptr), (len))):(empty_string))
176
+ #define safe_estrndup (ptr , len ) ((ptr)?(_strndup ((ptr), (len))):(empty_string))
175
177
176
178
#endif
177
179
0 commit comments