diff --git a/hs.c b/hs.c index ffec9c8..a9c0c38 100644 --- a/hs.c +++ b/hs.c @@ -168,7 +168,11 @@ static ZEND_FUNCTION(hs_compress) RETURN_FALSE; } if (fres == HSER_FINISH_DONE) { +#if PHP_MAJOR_VERSION == 7 + RETVAL_STRINGL((char *) outbuff, poll_sz); +#else RETVAL_STRINGL((char *) outbuff, poll_sz, 1); +#endif efree(outbuff); heatshrink_encoder_free(hse); return; @@ -259,7 +263,11 @@ static ZEND_FUNCTION(hs_decompress) RETURN_FALSE; } if (fres == HSDR_FINISH_DONE) { +#if PHP_MAJOR_VERSION == 7 + RETVAL_STRINGL((char *) outbuff, poll_sz); +#else RETVAL_STRINGL((char *) outbuff, poll_sz, 1); +#endif efree(outbuff); heatshrink_decoder_free(hsd); return;