Skip to contentSkip to conversation

printf.3: Return the number of bytes printed, not characters

PATCH In review Jeremy Baxter 2 participants 2 messages Mar 15, 2024 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 printf.3: Return the number of bytes printed, not characters

From https://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html:

Upon successful completion, the dprintf(), fprintf(), and printf() functions shall return the number of bytes transmitted.

Fixes bug 218600 <https://bugzilla.kernel.org/show_bug.cgi?id=218600>.

---
 man3/printf.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man3/printf.3 +1 -1
index eb152aa19..15ed75439 100644
@@ -875,7 +875,7 @@ No argument is converted.
 The complete conversion
 specification is \[aq]%%\[aq].
 .SH RETURN VALUE
-Upon successful return, these functions return the number of characters
+Upon successful return, these functions return the number of bytes
 printed (excluding the null byte used to end output to strings).
 .P
 The functions
Signature · 1 line
2.44.0
#1 lore raw

Hi Jeremy,

Quoted 7 lines · Jeremy Baxter

From https://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html:

Upon successful completion, the dprintf(), fprintf(), and printf() functions shall return the number of bytes transmitted.

Fixes bug 218600 <https://bugzilla.kernel.org/show_bug.cgi?id=218600>.

Quoted 1 line

Patch applied; thanks.
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=e0fc7ee5e3d664c83bd0f4fc751ef80cf38ae1bc>

Have a lovely night!
Alex

Quoted 20 lines
---
 man3/printf.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man3/printf.3 +1 -1
index eb152aa19..15ed75439 100644
@@ -875,7 +875,7 @@ No argument is converted.
 The complete conversion
 specification is \[aq]%%\[aq].
 .SH RETURN VALUE
-Upon successful return, these functions return the number of characters
+Upon successful return, these functions return the number of bytes
 printed (excluding the null byte used to end output to strings).
 .P
 The functions
Signature · 1 line
2.44.0
Signature · 1 line
<https://www.alejandro-colomar.es/>