/* 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
}
/* Memory allocation. */
- if (*resultp != NULL && *lengthp >= srclen)
+ if ((*resultp != NULL && *lengthp >= srclen) || srclen == 0)
result = *resultp;
else
{