This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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]

[Bug stdio/17829] Incorrect handling of precision specifier in printf family


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.

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