Bug 681781 - snprintf man page is wrong
Summary: snprintf man page is wrong
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: man-pages
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ivana Varekova
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-03 08:44 UTC by Jakub Jelinek
Modified: 2011-03-25 13:00 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-25 13:00:40 UTC
Type: ---


Attachments (Terms of Use)

Description Jakub Jelinek 2011-03-03 08:44:01 UTC
"The  trailing null byte won't be added to str, if the string is truncated." claim in man 3 snprintf (seen on F14 up to latest f16 man pages in mock buildroot)
is wrong, it is not what glibc snprintf implements nor what man 3p snprintf
says.  snprintf terminates the string with a null byte always, unless the size is zero (then it of course doesn't write anything).

Comment 1 Ivana Varekova 2011-03-25 13:00:40 UTC
Thanks, resolves in man-pages-3.32-11.fc16
changed to 
The trailing null byte is added to str, unless size is zero.


Note You need to log in before you can comment on or make changes to this bug.