helly Thu Jan 18 23:11:43 2007 UTC
Modified files:
/php-src/main spprintf.c spprintf.h
Log:
- We need to return the length not the byte size
http://cvs.php.net/viewvc.cgi/php-src/main/spprintf.c?r1=1.42&r2=1.43&diff_format=u
Index: php-src/main/spprintf.c
diff -u php-src/main/spprintf.c:1.42 php-src/main/spprintf.c:1.43
--- php-src/main/spprintf.c:1.42 Thu Jan 18 21:39:50 2007
+++ php-src/main/spprintf.c Thu Jan 18 23:11:42 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spprintf.c,v 1.42 2007/01/18 21:39:50 helly Exp $ */
+/* $Id: spprintf.c,v 1.43 2007/01/18 23:11:42 helly Exp $ */
/* This is the spprintf implementation.
* It has emerged from apache snprintf. See original header:
@@ -872,7 +872,7 @@
*pbuf = (UChar*)xbuf.c;
- return xbuf.len;
+ return xbuf.len >> 1;
}
PHPAPI int uspprintf(UChar **pbuf, size_t max_len, const char *format, ...)
http://cvs.php.net/viewvc.cgi/php-src/main/spprintf.h?r1=1.16&r2=1.17&diff_format=u
Index: php-src/main/spprintf.h
diff -u php-src/main/spprintf.h:1.16 php-src/main/spprintf.h:1.17
--- php-src/main/spprintf.h:1.16 Thu Jan 18 21:39:50 2007
+++ php-src/main/spprintf.h Thu Jan 18 23:11:42 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spprintf.h,v 1.16 2007/01/18 21:39:50 helly Exp $ */
+/* $Id: spprintf.h,v 1.17 2007/01/18 23:11:42 helly Exp $ */
/*
@@ -27,6 +27,9 @@
that purpose snprintf is faster. When both pbuf and the return value are 0
than you are out of memory.
+All functions return the number of character printed (e.g. length), not the
+number of bytes.
+
There is also snprintf: See difference explained in snprintf.h
*/
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php