Re: Probably a simple answer...
| From: | brad lafountain | Date: | Tue, 14 May 2002 14:51:18 +0000 |
| Subject: | Re: Probably a simple answer... | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-84046@lists.php.net to get a copy of this message | ||
--- Robert Cummings <robert.cummings@webmotion.com> wrote:
> Robert Cummings wrote:
> >
> > brad lafountain wrote:
> > >
> > > Well i do believe that the zval string SHOULD be null termiated and have
> the
> > > length stored.
> >
> > You would think so, but on further thought, if that were the case you
> > wouldn't be able to store compressed data from gzip in a string because
> > the null bytes everywhere would interfere. Also, as I said, ZVAL_STRING
> > suggests that this is so... since when you use it to set a zval container
> > to a string it saves the length as strlen( passedString ), rather
> > than strlen( passedString ) + 1, also the memcpy then uses this length
> ^^^^^^
> I just took another look at ZVAL_STRING and it uses estrndup and
> not memcpy... maybe I'm losing my mind :)
well ZVAL_STRING should be fine for non binary strings.. but if you have binary
string you can use ZVAL_STRINGL(s,l,d)
- Brad
>
> Cheers,
> Rob.
> --
> .-----------------.
> | Robert Cummings |
> :-----------------`----------------------------.
> | Webdeployer - Chief PHP and Java Programmer |
> :----------------------------------------------:
> | Mail : mailto:robert.cummings@webmotion.com |
> | Phone : (613) 731-4046 x.109 |
> :----------------------------------------------:
> | Website : http://www.webmotion.com |
> | Fax : (613) 260-9545 |
> `----------------------------------------------'
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com