Bug 5345 - vsnprintf error
vsnprintf error
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: man-pages (Show other bugs)
6.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Cristian Gafton
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-09-24 04:30 EDT by spock
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-10-05 02:08:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description spock 1999-09-24 04:30:24 EDT
The man page for vsnprintf states:
RETURN VALUE
     If  the output was truncated, the return value is -1,
otherwise it is the number of characters stored, not
including the terminating null.

That is not the case.  If I give it a string 10 characters
long, and ask it to print out a string with 18 characters
vnsprintf will return 18, and not -1.  If this is not
considered a bug in the in man page, then it's the
implementation of vsnprintf.
Comment 1 Cristian Gafton 1999-10-05 02:08:59 EDT
The man page that I have states:
RETURN VALUE
       If the output was truncated, the return value is -1, otherwise
it is the number of characters
       stored,  not including the terminating null.  (Thus until glibc
2.0.6.  Since glibc 2.1 these
       functions return the  number of characters (excluding the
trailing  null)  which  would  have
       been written to the final string if enough space had been
available.)

Thus, the behavior (as mandated by Single Unix Specification ver 2) is
documented also in the man page.

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