From c749c9fddc73b23f98a7500086ed6e3fffae9c94 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 12 May 2014 12:42:33 -0600 Subject: [PATCH] perlapi: Give more accurate value for needed free space When converting to UTF-8, one usually doesn't need 14 bytes available space, which is what previously was claimed It acutally depends on the value being converted. This change gives the precise value. --- utf8.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/utf8.c b/utf8.c index dab5387..0ce3eb2 100644 --- a/utf8.c +++ b/utf8.c @@ -230,9 +230,9 @@ Perl_uvoffuni_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags) =for apidoc uvchr_to_utf8 Adds the UTF-8 representation of the native code point C to the end -of the string C; C should have at least C free -bytes available. The return value is the pointer to the byte after the -end of the new character. In other words, +of the string C; C should have at least C (up to +C) free bytes available. The return value is the pointer to +the byte after the end of the new character. In other words, d = uvchr_to_utf8(d, uv); @@ -259,9 +259,9 @@ Perl_uvchr_to_utf8(pTHX_ U8 *d, UV uv) =for apidoc uvchr_to_utf8_flags Adds the UTF-8 representation of the native code point C to the end -of the string C; C should have at least C free -bytes available. The return value is the pointer to the byte after the -end of the new character. In other words, +of the string C; C should have at least C (up to +C) free bytes available. The return value is the pointer to +the byte after the end of the new character. In other words, d = uvchr_to_utf8_flags(d, uv, flags); -- 2.7.4