Bug 681781

Summary: snprintf man page is wrong
Product: [Fedora] Fedora Reporter: Jakub Jelinek <jakub>
Component: man-pagesAssignee: Ivana Varekova <varekova>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: varekova
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-25 13:00:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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.