Re: should strings always be 0-terminated?
| From: | Zeev Suraski | Date: | Sun, 12 Nov 2000 14:01:49 +0000 |
| Subject: | Re: should strings always be 0-terminated? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-37817@lists.php.net to get a copy of this message | ||
Just to make it clear - there's no need to change any code that relies on the terminating NULL - that terminating NULL is mandatory.
Whenever possible, though, it's recommended to use binary-safe methods, based on the length property, which would both perform better and faster.
Zeev
At 15:19 12-11-00, Stig Venaas wrote:
A quick question: Should the string pointed to by value.str.val always be 0-terminated? Or should all code accessing the pval/zval use value.str.len? Since strings sometimes contain binary data, I would think value.str.len was used, but I'm not surprised if the 0 is necessary. Should all code relying on a terminating 0 be changed? Stig -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net