Re: snprintf heads-up
| From: | Stanislav Malyshev | Date: | Fri, 08 Sep 2000 14:09:18 +0000 |
| Subject: | Re: snprintf heads-up | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-32667@lists.php.net to get a copy of this message | ||
ZS>> written. As it doesn't always appear to be the case, the best approach
More precisely, it almost always is not the case, once the 'n' part comes
into play.
ZS>> IMHO would be using the bundled snprintf() always, regardless of whether
ZS>> snprintf() is available on the platform.
ZS>> As far as I can tell from glancing through snprintf.c, this version of
ZS>> snprintf() would return the number of characters that were effectively
ZS>> written under all circumstances (I could be wrong, we need to test it).
That would be highly confusing behaviour - calling something snprintf
where it isn't snprintf. Then we better call it safe_snprintf or something
like that.
--
Stanislav Malyshev stas@zend.com http://www.zend.com/
+972-3-6139665 ext.106