changeset 12615:aa6136434785

unistr/u8-to-u16: Reject invalid input.
author Bruno Haible <bruno@clisp.org>
date Sat, 09 Jan 2010 23:28:33 +0100
parents 94b68d3890f2
children 304d3cda1a9e
files ChangeLog lib/unistr/u8-to-u16.c modules/unistr/u8-to-u16
diffstat 3 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-01-09  Bruno Haible  <bruno@clisp.org>
+
+	unistr/u8-to-u16: Reject invalid input.
+	* lib/unistr/u8-to-u16.c (u8_to_u16): Call u8_mbtoucr instead of
+	u8_mbtouc.
+	* modules/unistr/u8-to-u16 (Depends-on): Add unistr/u8-mbtoucr.
+	Remove unistr/u8-mbtouc.
+
 2010-01-09  Bruno Haible  <bruno@clisp.org>
 
 	Tests for module 'getlogin'.
--- a/lib/unistr/u8-to-u16.c
+++ b/lib/unistr/u8-to-u16.c
@@ -58,7 +58,7 @@
       int count;
 
       /* Fetch a Unicode character from the input string.  */
-      count = u8_mbtouc (&uc, s, s_end - s);
+      count = u8_mbtoucr (&uc, s, s_end - s);
       if (count < 0)
         {
           if (!(result == resultbuf || result == NULL))
--- a/modules/unistr/u8-to-u16
+++ b/modules/unistr/u8-to-u16
@@ -6,7 +6,7 @@
 
 Depends-on:
 unistr/base
-unistr/u8-mbtouc
+unistr/u8-mbtoucr
 unistr/u16-uctomb
 
 configure.ac: