This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug stdio/17829] Incorrect handling of precision specifier in printf family
- From: "vincent-srcware at vinc17 dot net" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 22 May 2017 14:53:43 +0000
- Subject: [Bug stdio/17829] Incorrect handling of precision specifier in printf family
- Auto-submitted: auto-generated
- References: <bug-17829-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=17829
--- Comment #13 from Vincent Lefèvre <vincent-srcware at vinc17 dot net> ---
(In reply to Florian Weimer from comment #12)
> (In reply to Vincent Lefèvre from comment #11)
> > (In reply to Florian Weimer from comment #10)
> > > See bug 14771 comment 4.
> >
> > This is a different issue. I'm not talking about the size argument, but the
> > 'n' format specifier.
>
> They are related.
Bug 14771 comment 4 was about a conflict between ISO C and POSIX, and doesn't
give a hint here.
> I'm not sure if it is reasonable to expect that if snprintf fails with
> EOVERFLOW, %n output has been written.
There is no %n output. %n allows one to get information about the length of
some sequence of characters. According to bug 21360, one should get a
"meaningful" value, even for something that would *never* be output. So, if one
follows this idea, it could be reasonable to expect a meaningful value if int
is too small for the return value, e.g. to overcome the limitation of the int
type.
--
You are receiving this mail because:
You are on the CC list for the bug.