Re: concatenating strings
| From: | Peter Bowen | Date: | Fri, 24 Aug 2001 21:06:47 +0000 |
| Subject: | Re: concatenating strings | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-64283@lists.php.net to get a copy of this message | ||
I am getting a SIGSEGV with this function. I am probably just missing
something. I was hoping for a function with the prototype
strcatl(zval **z, char *s, int l);
strcat(zval **z, char *s);
Lacking those, I tried
zval **data;
/* call to zend_hash_find to set data */
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, s, l, 1);
add_string_to_string(*data, *data, tmp);
What am I missing?
Thanks.
Peter
On 24 Aug 2001 11:02:51 +0300, Zeev Suraski wrote:
> Look at add_string_to_string().
>
> At 04:14 24-08-01, Peter Bowen wrote:
> >I am writing an extension, and trying to figure out how to append to an
> >existing string. I have a pointer to a zval that is a string, and a
> >pointer to another string, along with the other string's length. I have
> >looked for a ZEND_STRCAT macro, or something similar, but don't see
> >anything. What is the proper/best way to handle this?
> >
> >Thanks.
> >Peter
> >
> --
> Zeev Suraski <zeev@zend.com>
> CTO & co-founder, Zend Technologies Ltd.
> http://www.zend.com/