This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: mbrtowc bug


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Corinna Vinschen on 7/20/2009 5:55 AM:
> 
> What bug?!?  When I run this testcase on Cygwin 1.7, it returns 0.  What
> is the supposed error and what is expected if it's behaving correctly?

Hmm.  Here's what it did for me on Windows XP (maybe the bug is in the
underlying Windows functions, which has since been fixed in your Windows
version?)

Breakpoint 1, main () at foo.c:5
5       {
(gdb) n
6         if (setlocale (LC_ALL, "ja_JP.eucJP") != NULL)
(gdb)
8             char input[] = "B\217\253\344\217\251\316er";
(gdb)
13            memset (&state, '\0', sizeof (mbstate_t));
(gdb)
14            if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
(gdb)
16                input[1] = '\0';
(gdb)
17                if (mbrtowc (&wc, input + 2, 5, &state) != 2)
(gdb)
18                  return 1;
(gdb)

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpkXAcACgkQ84KuGfSFAYCUGgCggywgNKTpC3eAkRZ/eXpIyz1J
uxQAnjdfODyhH2tr17obi/BaNu6kdk1E
=0l5s
-----END PGP SIGNATURE-----

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]