summaryrefslogtreecommitdiff
path: root/Zend/zend.h
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-12-21 20:30:04 +0000
committerZeev Suraski <zeev@php.net>1999-12-21 20:30:04 +0000
commitf0888ccaef222093c962eef72857e424f0fc5cb7 (patch)
treedd5ae96c2287110b9cd62898ec5b10908460ccf1 /Zend/zend.h
parent42847f7d5c434b5ee9c57026b8215df883575d4e (diff)
downloadphp-git-f0888ccaef222093c962eef72857e424f0fc5cb7.tar.gz
Fix the highlighting problem. STR_REALLOC() should be used instead of plain erealloc()
whenever you're dealing with strings that might be coming back from the engine - there seem to be a few other places like this in PHP.
Diffstat (limited to 'Zend/zend.h')
-rw-r--r--Zend/zend.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Zend/zend.h b/Zend/zend.h
index ea66e2da2c..1c1871e985 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -231,6 +231,14 @@ ZEND_API extern char *undefined_variable_string;
#define STR_FREE(ptr) if (ptr && ptr!=empty_string && ptr!=undefined_variable_string) { efree(ptr); }
#define STR_FREE_REL(ptr) if (ptr && ptr!=empty_string && ptr!=undefined_variable_string) { efree_rel(ptr); }
+#define STR_REALLOC(ptr, size) \
+ if (ptr!=empty_string && ptr!=undefined_variable_string) { \
+ ptr = (char *) erealloc(ptr, size); \
+ } else { \
+ ptr = (char *) emalloc(size); \
+ memset(ptr, 0, size); \
+ }
+
/* output support */
#define ZEND_WRITE(str, str_len) zend_write((str), (str_len))
#define ZEND_PUTS(str) zend_write((str), strlen((str)))