This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/649] printf("%.*s", str) bug in a Qt application, also sprintf(s, "%.*s", str) bug
- From: "jakub at redhat dot com" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 11 Jan 2005 10:21:14 -0000
- Subject: [Bug libc/649] printf("%.*s", str) bug in a Qt application, also sprintf(s, "%.*s", str) bug
- References: <20050111093528.649.develop@durst.de>
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
------- Additional Comments From jakub at redhat dot com 2005-01-11 10:21 -------
My guess is that Qt calls setlocale (LC_ALL, "") or similarly and you are using
UTF-8 locale or something similar.
ISO C99 requires for %.*s to only write complete characters that fit below the
precision number of bytes. If you are using say UTF-8 locale, but ISO-8859-1
characters as shown in the input file you provided, some of the strings are
not valid UTF-8 strings, therefore sprintf fails with -1 because of the
encoding error.
That's not a bug in glibc.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
Summary| printf("%.*s", str) bug in |printf("%.*s", str) bug in a
|a Qt application, also |Qt application, also
|sprintf(s, "%.*s", str) bug |sprintf(s, "%.*s", str) bug
http://sources.redhat.com/bugzilla/show_bug.cgi?id=649
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.