The length parameters in mbstowcs and wcstombs are limits on the
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 21 Jun 2007 14:10:01 +0000 (14:10 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 21 Jun 2007 14:10:01 +0000 (14:10 +0000)
commit8281de1b0ad1dcc60b353f8890d7e72391845365
tree22b91513b0badde3fb7d63e8af00db9df0a3626f
parent97b77c9ad5fe27e0b2a666597351ea89ccf93f58
The length parameters in mbstowcs and wcstombs are limits on the
_output_ length, not the input length. Adjust accordingly.

This has the side effect of working around what I believe to be a
bug in DJGPP's mbstowcs(), namely that if you give it a string which
exactly fits in the output length _without_ the trailing NUL, then
it will write n-1 characters of the string plus a NUL where I
believe it should write n characters of the string and no NUL.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@7622 cda61777-01e9-0310-a592-d414129be87e
ustring.c