summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2021-07-25 16:48:28 +0200
committerBruno Haible <bruno@clisp.org>2021-07-25 16:48:28 +0200
commit01888dcca8255a86603c7d5e42bf67dd827138ff (patch)
tree4907cafabc1320454f7d4190f89e01bd91218cba
parent2d70bedcfdf45b877df664fab0ce6dacabbe3f7b (diff)
downloadlibunistring-01888dcca8255a86603c7d5e42bf67dd827138ff.tar.gz
u{8,16,32}-uctomb: Avoid possible trouble with huge strings.
* doc/unistr.texi (Creating Unicode strings): Update prototypes of u8_uctomb, u16_uctomb, u32_uctomb to match the change in gnulib on 2020-09-05.
-rw-r--r--ChangeLog7
-rw-r--r--NEWS2
-rw-r--r--doc/unistr.texi6
3 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c1674a..277a6e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-07-25 Bruno Haible <bruno@clisp.org>
+
+ u{8,16,32}-uctomb: Avoid possible trouble with huge strings.
+ * doc/unistr.texi (Creating Unicode strings): Update prototypes of
+ u8_uctomb, u16_uctomb, u32_uctomb to match the change in gnulib on
+ 2020-09-05.
+
2021-05-30 Bruno Haible <bruno@clisp.org>
Change license to LGPLv3+ or GPLv2+.
diff --git a/NEWS b/NEWS
index 9276191..42b6cd2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
New in 0.9.11:
* The license has changed from "LGPLv3+ or GPLv2" to "LGPLv3+ or GPLv2+".
+* The functions u8_uctomb, u16_uctomb, u32_uctomb now support strings larger
+ than 2 GiB by taking an 'n' argument of type ptrdiff_t (instead of int).
* Fixed multithread-safety bugs on Cygwin, native Windows, and Haiku.
New in 0.9.10:
diff --git a/doc/unistr.texi b/doc/unistr.texi
index c59094d..d26a3f3 100644
--- a/doc/unistr.texi
+++ b/doc/unistr.texi
@@ -152,9 +152,9 @@ gives more details about the failure, similar to @posixfunc{mbrtowc}.
The following function stores a Unicode character as a Unicode string in
memory.
-@deftypefun int u8_uctomb (uint8_t@tie{}*@var{s}, ucs4_t@tie{}@var{uc}, int@tie{}@var{n})
-@deftypefunx int u16_uctomb (uint16_t@tie{}*@var{s}, ucs4_t@tie{}@var{uc}, int@tie{}@var{n})
-@deftypefunx int u32_uctomb (uint32_t@tie{}*@var{s}, ucs4_t@tie{}@var{uc}, int@tie{}@var{n})
+@deftypefun int u8_uctomb (uint8_t@tie{}*@var{s}, ucs4_t@tie{}@var{uc}, ptrdiff_t@tie{}@var{n})
+@deftypefunx int u16_uctomb (uint16_t@tie{}*@var{s}, ucs4_t@tie{}@var{uc}, ptrdiff_t@tie{}@var{n})
+@deftypefunx int u32_uctomb (uint32_t@tie{}*@var{s}, ucs4_t@tie{}@var{uc}, ptrdiff_t@tie{}@var{n})
Puts the multibyte character represented by @var{uc} in @var{s}, returning its
length. Returns -1 upon failure, -2 if the number of available units, @var{n},
is too small. The latter case cannot occur if @var{n} >= 6/2/1, respectively.