Re: Programming question
| From: | Jeroen van Wolffelaar | Date: | Fri, 03 Aug 2001 19:04:22 +0000 |
| Subject: | Re: Programming question | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-62006@lists.php.net to get a copy of this message | ||
> At 02:13 PM 8/2/2001 +0200, jeroen@php.net wrote:
> All zval strings in PHP *have* to be null-terminated even if the string
> contains binary data and nulls. So yes, you can assume that it will always
> be null-terminated, however, if your function is binary safe (which in
most
> cases it should be) then you should work with the string's length and not
> the null-termination.
Yes, that's what I meant.
Some (most?) PHP_API functions allow the length specified to be zero, and
then look for the next NULL-byte. This only goes well if PHP-strings are
always NULL-terminated (NULLs within are not relevant in this case).
Thanks for clearing this up.
Jeroen