diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-03-15 20:41:16 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-03-15 20:41:16 +0000 |
commit | b117f744e10e769a5d219cf0b69cc10f81738650 (patch) | |
tree | 35f76b5a32b99735df14db028185e85df3834c33 /wcsmbs/mbsrtowcs.c | |
parent | 1d0b8e4b8f9c636cfaec78be5ebf819d3d8c2284 (diff) | |
download | glibc-b117f744e10e769a5d219cf0b69cc10f81738650.zip glibc-b117f744e10e769a5d219cf0b69cc10f81738650.tar.gz glibc-b117f744e10e769a5d219cf0b69cc10f81738650.tar.bz2 |
Update.
1999-03-15 Ulrich Drepper <drepper@cygnus.com>
* iconv/gconv.h (gconv_fct): Change parameter from `char' to
`unsigned char'.
(gconv_step_data): Likewise.
* iconv/gconv_int.h (__gconv): Likewise.
(__BUILINT_TRANS): Likewise.
* iconv/gconv.c (__gconv): Likewise.
* iconv/iconv.c (iconv): Add casts for call of __gconv.
* iconv/skeleton.c: Change local parameters and variable from `char' to
`unsigned char'. Remove casts from calls into modules.
* iconvdata/iso-2022-jp.c (gconv): Change local variable outbuf from
`char' to `unsigned char'.
* wcsmbs/btowc.c: Change pointers from `char *' to `unsigned char *'.
* wcsmbs/mbrtowc.c: Likewise.
* wcsmbs/mbsnrtowcs.c: Likewise.
* wcsmbs/mbsrtowcs.c: Likewise.
* wcsmbs/wcrtomb.c: Likewise.
* wcsmbs/wcsnrtombs.c: Likewise.
* wcsmbs/wcsrtombs.c: Likewise.
* wcsmbs/wctob.c: Likewise.
Diffstat (limited to 'wcsmbs/mbsrtowcs.c')
-rw-r--r-- | wcsmbs/mbsrtowcs.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/wcsmbs/mbsrtowcs.c b/wcsmbs/mbsrtowcs.c index 1993e2e..a10eb85 100644 --- a/wcsmbs/mbsrtowcs.c +++ b/wcsmbs/mbsrtowcs.c @@ -58,8 +58,8 @@ __mbsrtowcs (dst, src, len, ps) if (dst == NULL) { wchar_t buf[64]; /* Just an arbitrary size. */ - const char *srcend = *src + strlen (*src) + 1; - const char *inbuf = *src; + const unsigned char *inbuf = (const unsigned char *) *src; + const unsigned char *srcend = inbuf + strlen (inbuf) + 1; data.outbufend = data.outbuf + sizeof (buf); do @@ -85,14 +85,19 @@ __mbsrtowcs (dst, src, len, ps) /* This code is based on the safe assumption that all internal multi-byte encodings use the NUL byte only to mark the end of the string. */ - const char *srcend = *src + __strnlen (*src, len * MB_CUR_MAX) + 1; + const unsigned char *srcend; - data.outbuf = (char *) dst; + srcend = (const unsigned char *) (*src + + __strnlen (*src, len * MB_CUR_MAX) + + 1); + + data.outbuf = (unsigned char *) dst; data.outbufend = data.outbuf + len * sizeof (wchar_t); status = (*__wcsmbs_gconv_fcts.towc->fct) (__wcsmbs_gconv_fcts.towc, - &data, src, srcend, - &result, 0); + &data, + (const unsigned char **) src, + srcend, &result, 0); /* We have to determine whether the last character converted is the NUL character. */ |