]> granicus.if.org Git - php/commitdiff
- We need to return the length not the byte size
authorMarcus Boerger <helly@php.net>
Thu, 18 Jan 2007 23:11:42 +0000 (23:11 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 18 Jan 2007 23:11:42 +0000 (23:11 +0000)
main/spprintf.c
main/spprintf.h

index 425a6105e14568d9542ff740cdacd3a2570ed49b..740479a6ded7cbbc8c3b8a01ea61eab8e5293c76 100644 (file)
@@ -872,7 +872,7 @@ PHPAPI int vuspprintf(UChar **pbuf, size_t max_len, const char *format, va_list
                
        *pbuf = (UChar*)xbuf.c;
        
-       return xbuf.len;
+       return xbuf.len >> 1;
 }
 
 PHPAPI int uspprintf(UChar **pbuf, size_t max_len, const char *format, ...)
index 3480e4e9bdd7e0dbad1c22f919d7b11b70738c6d..23c5cb4d0293cf632de3e9a9939e1a7b3cd177c5 100644 (file)
@@ -27,6 +27,9 @@ the function can be used to calculate the required size of the buffer but for
 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
 
 */