Avoid test failures on AIX and OSF/1.
[gnulib.git] / lib / uniconv / u8-conv-from-enc.c
index bcd0cd0..09eba1e 100644 (file)
@@ -1,5 +1,5 @@
 /* Conversion to UTF-8 from legacy encodings.
-   Copyright (C) 2002, 2006-2007 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006-2007, 2009 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
@@ -65,7 +65,7 @@ u8_conv_from_encoding (const char *fromcode,
        }
 
       /* Memory allocation.  */
-      if (*resultp != NULL && *lengthp >= srclen)
+      if ((*resultp != NULL && *lengthp >= srclen) || srclen == 0)
        result = *resultp;
       else
        {