diff options
Diffstat (limited to 'ext/standard/php_smart_str.h')
-rw-r--r-- | ext/standard/php_smart_str.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h index a518fbfddf..5cc3a62137 100644 --- a/ext/standard/php_smart_str.h +++ b/ext/standard/php_smart_str.h @@ -45,11 +45,11 @@ #ifdef SMART_STR_USE_REALLOC #define SMART_STR_DO_REALLOC(b, w) do { \ - (b)->s = erealloc((buf)->s, sizeof(zend_string) + (b)->a); \ + (b)->s = erealloc((buf)->s, _STR_HEADER_SIZE + (b)->a + 1); \ } while (0) #else #define SMART_STR_DO_REALLOC(b, w) do { \ - (b)->s = perealloc((b)->s, sizeof(zend_string) + (b)->a, (w)); \ + (b)->s = perealloc((b)->s, _STR_HEADER_SIZE + (b)->a + 1, (w)); \ } while (0) #endif |