Fix bug in error handling code.
authorBruno Haible <bruno@clisp.org>
Wed, 16 Apr 2008 01:35:29 +0000 (03:35 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 16 Apr 2008 01:35:29 +0000 (03:35 +0200)
ChangeLog
lib/uniconv/u-conv-to-enc.h

index c859ea60bb8923804565f7e72870263b145e664d..af5da0078c1937896a895fe3871301639f81544a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-15  Bruno Haible  <bruno@clisp.org>
+
+       * lib/uniconv/u-conv-to-enc.h (FUNC): Fix return value when U_TO_U8
+       fails.
+
 2008-04-15  Bruno Haible  <bruno@clisp.org>
 
        * lib/trim.c (trim2): Fix argument of isspace() macro.
index fa5835dc92f8f6b8f13ae0334417e3c7ab806ae2..b69a2b7f52de80de6a2089e818e45b3fb5b50980 100644 (file)
@@ -1,5 +1,5 @@
 /* Conversion from UTF-16/UTF-32 to legacy encodings.
-   Copyright (C) 2002, 2006-2007 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006-2008 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as published
@@ -67,7 +67,7 @@ FUNC (const char *tocode,
 
   utf8_src = U_TO_U8 (src, srclen, tmpbuf, &tmpbufsize);
   if (utf8_src == NULL)
-    return NULL;
+    return -1;
   utf8_srclen = tmpbufsize;
 
   if (offsets != NULL)