many ffixes

This commit is contained in:
Michael Kerrisk 2008-07-12 20:49:46 +00:00
parent 3a4ac59b3a
commit 512c4c1a1f
1 changed files with 27 additions and 19 deletions

View File

@ -563,7 +563,7 @@ and
A character that specifies the type of conversion to be applied.
The conversion specifiers and their meanings are:
.TP
.BR d , i
.BR d ", " i
The
.I int
argument is converted to signed decimal notation.
@ -573,7 +573,7 @@ padded on the left with zeros.
The default precision is 1.
When 0 is printed with an explicit precision 0, the output is empty.
.TP
.BR o , u , x , X
.BR o ", " u ", " x ", " X
The
.I "unsigned int"
argument is converted to unsigned octal
@ -600,7 +600,7 @@ padded on the left with zeros.
The default precision is 1.
When 0 is printed with an explicit precision 0, the output is empty.
.TP
.BR e , E
.BR e ", " E
The
.I double
argument is rounded and converted in the style
@ -620,7 +620,7 @@ to introduce the exponent.
The exponent always contains at least two
digits; if the value is zero, the exponent is 00.
.TP
.BR f , F
.BR f ", " F
The
.I double
argument is rounded and converted to decimal notation in the style
@ -642,7 +642,7 @@ conversion, and "[\-]INF" or "[\-]INFINITY" or "NAN*" in the case of
.B F
conversion.)
.TP
.BR g , G
.BR g ", " G
The
.I double
argument is converted in style
@ -667,7 +667,7 @@ Trailing zeros are removed from the
fractional part of the result; a decimal point appears only if it is
followed by at least one digit.
.TP
.BR a , A
.BR a ", " A
(C99; not in SUSv2) For
.B a
conversion, the
@ -819,29 +819,37 @@ as the number of characters that would have been written in case
the output string has been large enough.
.PP
Linux libc4 knows about the five C standard flags.
It knows about the length modifiers h,l,L, and the conversions
cdeEfFgGinopsuxX, where F is a synonym for f.
Additionally, it accepts D,O,U as synonyms for ld,lo,lu.
It knows about the length modifiers \fBh\fP, \fBl\fP, \fBL\fP,
and the conversions
\fBc\fP, \fBd\fP, \fBe\fP, \fBE\fP, \fBf\fP, \fBF\fP,
\fBg\fP, \fBG\fP, \fBi\fP, \fBn\fP, \fBo\fP, \fBp\fP,
\fBs\fP, \fBu\fP, \fBx\fP, and \fBX\fP,
where \fBF\fP is a synonym for \fBf\fP.
Additionally, it accepts \fBD\fP, \fBO\fP, and \fBU\fP as synonyms
for \fBld\fP, \fBlo\fP, and \fBlu\fP.
(This is bad, and caused serious bugs later, when
support for %D disappeared.)
support for \fB%D\fP disappeared.)
No locale-dependent radix character,
no thousands' separator, no NaN or infinity, no %m$ and *m$.
no thousands' separator, no NaN or infinity, no "%m$" and "*m$".
.PP
Linux libc5 knows about the five C standard flags and the \(aq flag,
locale, %m$ and *m$.
It knows about the length modifiers h,l,L,Z,q, but accepts L and q
locale, "%m$" and "*m$".
It knows about the length modifiers \fBh\fP, \fBl\fP, \fBL\fP,
\fBZ\fP, iand \fBq\fP, but accepts \fBL\fP and \fBq\fP
both for \fIlong double\fP and for \fIlong long int\fP (this is a bug).
It no longer recognizes FDOU, but adds the conversion character
It no longer recognizes \fBF\fP, \fBD\fP, \fBO\fP, and \fBU\fP,
but adds the conversion character
.BR m ,
which outputs
.IR strerror(errno) .
.PP
glibc 2.0 adds conversion characters C and S.
glibc 2.0 adds conversion characters \fBC\fP and \fBS\fP.
.PP
glibc 2.1 adds length modifiers hh,j,t,z and conversion characters a,A.
glibc 2.1 adds length modifiers \fBhh\fP, \fBj\fP, \fBt\fP, and \fBz\fP
and conversion characters \fBa\fP and\fBA\fP.
.PP
glibc 2.2 adds the conversion character F with C99 semantics, and the
flag character I.
glibc 2.2 adds the conversion character \fBF\fP with C99 semantics,
and the flag character \fBI\fP.
.SH NOTES
The glibc implementation of the functions
.BR snprintf ()
@ -922,7 +930,7 @@ often indicates a bug, since
may contain a % character.
If
.I foo
comes from untrusted user input, it may contain %n, causing the
comes from untrusted user input, it may contain \fB%n\fP, causing the
.BR printf ()
call to write to memory and creating a security hole.
.\" .PP