Avoid test failures on AIX and OSF/1.
[gnulib.git] / lib / uniconv / u8-conv-to-enc.c
index bc2cc09..85404d4 100644 (file)
@@ -1,5 +1,5 @@
 /* Conversion from UTF-8 to 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
@@ -50,7 +50,7 @@ u8_conv_to_encoding (const char *tocode,
 #endif
 
       /* Memory allocation.  */
-      if (*resultp != NULL && *lengthp >= srclen)
+      if ((*resultp != NULL && *lengthp >= srclen) || srclen == 0)
        result = *resultp;
       else
        {