summaryrefslogtreecommitdiff
path: root/ext/date/php_date.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date/php_date.c')
-rw-r--r--ext/date/php_date.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 3702e8e6d1..2f52353ce2 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1663,7 +1663,7 @@ PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
initial buffer is too small. See
http://connect.microsoft.com/VisualStudio/feedback/details/759720/vs2012-strftime-crash-with-z-formatting-code */
buf = zend_string_alloc(buf_len, 0);
- while ((real_len = strftime(buf->val, buf_len, format, &ta)) == buf_len || real_len == 0) {
+ while ((real_len = strftime(ZSTR_VAL(buf), buf_len, format, &ta)) == buf_len || real_len == 0) {
buf_len *= 2;
buf = zend_string_extend(buf, buf_len, 0);
if (!--max_reallocs) {
@@ -2191,7 +2191,7 @@ static HashTable *date_object_get_properties(zval *object) /* {{{ */
zend_string *tmpstr = zend_string_alloc(sizeof("UTC+05:00")-1, 0);
timelib_sll utc_offset = dateobj->time->z;
- tmpstr->len = snprintf(tmpstr->val, sizeof("+05:00"), "%c%02d:%02d",
+ ZSTR_LEN(tmpstr) = snprintf(ZSTR_VAL(tmpstr), sizeof("+05:00"), "%c%02d:%02d",
utc_offset > 0 ? '-' : '+',
abs(utc_offset / 60),
abs((utc_offset % 60)));
@@ -2283,7 +2283,7 @@ static HashTable *date_object_get_properties_timezone(zval *object) /* {{{ */
case TIMELIB_ZONETYPE_OFFSET: {
zend_string *tmpstr = zend_string_alloc(sizeof("UTC+05:00")-1, 0);
- tmpstr->len = snprintf(tmpstr->val, sizeof("+05:00"), "%c%02d:%02d",
+ ZSTR_LEN(tmpstr) = snprintf(ZSTR_VAL(tmpstr), sizeof("+05:00"), "%c%02d:%02d",
tzobj->tzi.utc_offset > 0 ? '-' : '+',
abs(tzobj->tzi.utc_offset / 60),
abs((tzobj->tzi.utc_offset % 60)));
@@ -3744,7 +3744,7 @@ PHP_FUNCTION(timezone_name_get)
zend_string *tmpstr = zend_string_alloc(sizeof("UTC+05:00")-1, 0);
timelib_sll utc_offset = tzobj->tzi.utc_offset;
- tmpstr->len = snprintf(tmpstr->val, sizeof("+05:00"), "%c%02d:%02d",
+ ZSTR_LEN(tmpstr) = snprintf(ZSTR_VAL(tmpstr), sizeof("+05:00"), "%c%02d:%02d",
utc_offset > 0 ? '-' : '+',
abs(utc_offset / 60),
abs((utc_offset % 60)));
@@ -4115,7 +4115,7 @@ static int php_date_interval_initialize_from_hash(zval **return_value, php_inter
zval *z_arg = zend_hash_str_find(myht, element, sizeof(element) - 1); \
if (z_arg) { \
zend_string *str = zval_get_string(z_arg); \
- DATE_A64I((*intobj)->diff->member, str->val); \
+ DATE_A64I((*intobj)->diff->member, ZSTR_VAL(str)); \
zend_string_release(str); \
} else { \
(*intobj)->diff->member = -1LL; \