From: Marcus Boerger Date: Thu, 18 Jan 2007 23:11:42 +0000 (+0000) Subject: - We need to return the length not the byte size X-Git-Tag: RELEASE_1_0_0RC1~218 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=511351bf9986032f40ddc05aefbaa7084b49b70a;p=php - We need to return the length not the byte size --- diff --git a/main/spprintf.c b/main/spprintf.c index 425a6105e1..740479a6de 100644 --- a/main/spprintf.c +++ b/main/spprintf.c @@ -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, ...) diff --git a/main/spprintf.h b/main/spprintf.h index 3480e4e9bd..23c5cb4d02 100644 --- a/main/spprintf.h +++ b/main/spprintf.h @@ -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 */