Skip to content

Conversation

@tpunt
Copy link
Contributor

@tpunt tpunt commented Mar 23, 2016

Fixes a segfault when using DateInterval::format('%'). This affects PHP 7 and master too.

/cc @derickr

@tpunt tpunt force-pushed the fix-dateinterval-segfault branch from 4b5ffb8 to 872a368 Compare March 23, 2016 23:56
@tpunt tpunt force-pushed the fix-dateinterval-segfault branch from 872a368 to 6be549e Compare March 23, 2016 23:57
smart_str_0(&string);

if (string.c == NULL) {
return estrdup("");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use:

return STR_EMPTY_ALLOC();

for PHP7 use:

return ZSTR_EMPTY_ALLOC();
@derickr
Copy link
Member

derickr commented Mar 24, 2016

LGTM, after you:

  • fixed the things that @laruence pointed out
@tpunt
Copy link
Contributor Author

tpunt commented Mar 24, 2016

Thanks for the reviews. I've rectified the patch and Travis passes now.

@php-pulls
Copy link

Comment on behalf of ab at php.net:

Merged in 5.6+ with 40f14ba and 1aea777.

Thanks.

@php-pulls php-pulls closed this Apr 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants