summaryrefslogtreecommitdiff
path: root/wcsmbs/mbrtowc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-03-15 20:41:16 +0000
committerUlrich Drepper <drepper@redhat.com>1999-03-15 20:41:16 +0000
commitb117f744e10e769a5d219cf0b69cc10f81738650 (patch)
tree35f76b5a32b99735df14db028185e85df3834c33 /wcsmbs/mbrtowc.c
parent1d0b8e4b8f9c636cfaec78be5ebf819d3d8c2284 (diff)
downloadglibc-b117f744e10e769a5d219cf0b69cc10f81738650.tar.gz
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/mbrtowc.c')
-rw-r--r--wcsmbs/mbrtowc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/wcsmbs/mbrtowc.c b/wcsmbs/mbrtowc.c
index bf995ec713..78ff2a22dd 100644
--- a/wcsmbs/mbrtowc.c
+++ b/wcsmbs/mbrtowc.c
@@ -39,7 +39,7 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
int status;
size_t result;
size_t dummy;
- const char *inbuf;
+ const unsigned char *inbuf;
char *outbuf = (char *) (pwc ?: buf);
/* Tell where we want the result. */
@@ -63,7 +63,7 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
update_conversion_ptrs ();
/* Do a normal conversion. */
- inbuf = s;
+ inbuf = (const unsigned char *) s;
status = (*__wcsmbs_gconv_fcts.towc->fct) (__wcsmbs_gconv_fcts.towc,
&data, &inbuf, inbuf + n,
&dummy, 0);
@@ -80,14 +80,15 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
if (status == GCONV_OK || status == GCONV_EMPTY_INPUT
|| status == GCONV_FULL_OUTPUT)
{
- if (data.outbuf != outbuf && *(wchar_t *)outbuf == L'\0')
+ if (data.outbuf != (unsigned char *) outbuf
+ && *(wchar_t *) outbuf == L'\0')
{
/* The converted character is the NUL character. */
assert (__mbsinit (data.statep));
result = 0;
}
else
- result = inbuf - s;
+ result = inbuf - (const unsigned char *) s;
}
else
{