diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2005-08-11 20:51:57 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2005-08-11 20:51:57 +0000 |
commit | 18d89504abf92ee7d9e282170ccaaa372d8240db (patch) | |
tree | affafb6d148294fadd2ac85b7f6ef45132a1ffe0 /lib/libc | |
parent | 9e56497b20e9511367d2e3e49c4a8ed7b4921a79 (diff) |
fix conversion to match iswctype.
`why didn't you just commit' deraadt@
okay millert@, otto@...
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/locale/mbrtowc_sb.c | 4 | ||||
-rw-r--r-- | lib/libc/locale/multibyte_sb.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/locale/mbrtowc_sb.c b/lib/libc/locale/mbrtowc_sb.c index 649ec261e6d..9516656f5ae 100644 --- a/lib/libc/locale/mbrtowc_sb.c +++ b/lib/libc/locale/mbrtowc_sb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mbrtowc_sb.c,v 1.2 2005/08/08 08:05:35 espie Exp $ */ +/* $OpenBSD: mbrtowc_sb.c,v 1.3 2005/08/11 20:51:56 espie Exp $ */ /* $NetBSD: multibyte_sb.c,v 1.4 2003/08/07 16:43:04 agc Exp $ */ /* @@ -48,7 +48,7 @@ mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) if (n == 0) return -1; if (pwc) - *pwc = (wchar_t) *s; + *pwc = (wchar_t)(unsigned char)*s; return (*s != '\0'); } diff --git a/lib/libc/locale/multibyte_sb.c b/lib/libc/locale/multibyte_sb.c index 1dd87e8d6d6..b34802d2f66 100644 --- a/lib/libc/locale/multibyte_sb.c +++ b/lib/libc/locale/multibyte_sb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: multibyte_sb.c,v 1.4 2005/08/08 08:05:35 espie Exp $ */ +/* $OpenBSD: multibyte_sb.c,v 1.5 2005/08/11 20:51:56 espie Exp $ */ /* $NetBSD: multibyte_sb.c,v 1.4 2003/08/07 16:43:04 agc Exp $ */ /* @@ -111,7 +111,7 @@ mbsrtowcs(wchar_t *pwcs, const char **s, size_t n, mbstate_t *ps) if (n != 0) { if (pwcs != NULL) { do { - if ((*pwcs++ = (wchar_t) *(*s)++) == 0) + if ((*pwcs++ = (wchar_t)(unsigned char)*(*s)++) == 0) break; count++; } while (--n != 0); |