Fix bug getting cstring from literal containing illegal characters.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25227 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2007-06-08 06:00:11 +00:00
parent fb633a8a16
commit d91962866d
3 changed files with 11 additions and 0 deletions

View file

@ -1864,6 +1864,7 @@ getCStringE_c(GSStr self, char *buffer, unsigned int maxLength,
* from internal format to unicode and then to the specified
* C string encoding.
*/
bytes = maxLength - sizeof(char);
if (GSToUnicode(&u, &l, self->_contents.c, self->_count,
internalEncoding, NSDefaultMallocZone(), 0) == NO)
{