Re: Programming question
| From: | Andi Gutmans | Date: | Fri, 03 Aug 2001 05:29:22 +0000 |
| Subject: | Re: Programming question | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-61914@lists.php.net to get a copy of this message | ||
At 02:13 PM 8/2/2001 +0200, jeroen@php.net wrote:
Hi, can it be assumed that zval.str.val[zval.str.len] = '\0'? i.e., the byte after the string in a zval is the null-byte? That is assumed in various places in ext/standard/string.c, and AFAIK that may not always be true.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. Andi