aboutsummaryrefslogtreecommitdiff
path: root/wcsmbs/mbsnrtowcs.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-04-29 12:15:49 +0000
committerUlrich Drepper <drepper@redhat.com>1998-04-29 12:15:49 +0000
commit5e7a22c9c3d09ad8bdefb127eb4a0faeee5fbb0b (patch)
tree721a0884bdb59f87db85171a056d51b1e246e467 /wcsmbs/mbsnrtowcs.c
parentbf979eef1d8d6c6e9b5ad623d47ce9bab20b8be9 (diff)
downloadglibc-5e7a22c9c3d09ad8bdefb127eb4a0faeee5fbb0b.zip
glibc-5e7a22c9c3d09ad8bdefb127eb4a0faeee5fbb0b.tar.gz
glibc-5e7a22c9c3d09ad8bdefb127eb4a0faeee5fbb0b.tar.bz2
Update.
1998-04-29 12:11 Ulrich Drepper <drepper@cygnus.com> * wcsmbs/mbsnrtowcs.c: Remove variable to pass to conversion function by letting the later modify the variable computing the total directly. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/btowc.c (converted): Rename variable to dummy to make clear it is not used. * wcsmbs/wctoc.c: Likewise.
Diffstat (limited to 'wcsmbs/mbsnrtowcs.c')
-rw-r--r--wcsmbs/mbsnrtowcs.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/wcsmbs/mbsnrtowcs.c b/wcsmbs/mbsnrtowcs.c
index 46a718b..790e777 100644
--- a/wcsmbs/mbsnrtowcs.c
+++ b/wcsmbs/mbsnrtowcs.c
@@ -65,21 +65,17 @@ __mbsnrtowcs (dst, src, nmc, len, ps)
{
wchar_t buf[64]; /* Just an arbitrary size. */
const char *inbuf = *src;
- size_t written;
data.outbuf = (char *) buf;
data.outbufend = data.outbuf + sizeof (buf);
do
- {
- status = (*__wcsmbs_gconv_fcts.towc->fct) (__wcsmbs_gconv_fcts.towc,
- &data, &inbuf, srcend,
- &written, 0);
- result += written;
- }
+ status = (*__wcsmbs_gconv_fcts.towc->fct) (__wcsmbs_gconv_fcts.towc,
+ &data, &inbuf, srcend,
+ &result, 0);
while (status == GCONV_FULL_OUTPUT);
if ((status == GCONV_OK || status == GCONV_EMPTY_INPUT)
- && buf[written - 1] == L'\0')
+ && ((wchar_t *) data.outbuf)[-1] == L'\0')
/* Don't count the NUL character in. */
--result;
}