aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-11-18 21:08:05 +0000
committerUlrich Drepper <drepper@redhat.com>2000-11-18 21:08:05 +0000
commitbb2fc8504d9aaa024bdfd2d630f4241c0e24bbf5 (patch)
tree9bb185e64b7184263be4830747fea4d6bc6d989b /wcsmbs/mbrtowc.c
parentUpdate. (diff)
downloadglibc-bb2fc8504d9aaa024bdfd2d630f4241c0e24bbf5.tar.gz
glibc-bb2fc8504d9aaa024bdfd2d630f4241c0e24bbf5.tar.bz2
glibc-bb2fc8504d9aaa024bdfd2d630f4241c0e24bbf5.zip
Update.
2000-11-18 Ulrich Drepper <drepper@redhat.com> * wcsmbs/mbrtowc.c (__mbrtowc): Do not only flush if input is '\0'. * wcsmbs/Makefile (tests): Add tst-mbrtowc and tst-wcrtomb. (tst-mbrtowc-ENV): New variable. (tst-wcrtomb-ENV): New variable. * wcsmbs/tst-mbrtowc.c: New file. * wcsmbs/tst-wcrtomb.c: New file.
Diffstat (limited to 'wcsmbs/mbrtowc.c')
-rw-r--r--wcsmbs/mbrtowc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/wcsmbs/mbrtowc.c b/wcsmbs/mbrtowc.c
index 034ccfec41..7c05680d91 100644
--- a/wcsmbs/mbrtowc.c
+++ b/wcsmbs/mbrtowc.c
@@ -42,7 +42,7 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
size_t dummy;
const unsigned char *inbuf;
char *outbuf = (char *) (pwc ?: buf);
- int flush;
+ int flush = 0;
/* Set information for this step. */
data.__invocation_counter = 0;
@@ -60,8 +60,6 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
n = 1;
flush = 1;
}
- else
- flush = *s == '\0' ? 1 : 0;
/* Tell where we want the result. */
data.__outbuf = outbuf;