Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (s) snprintf(3)
RETURN VALUES
Upon successful completion, this function returns the number of bytes that would have been
stored had n been sufciently large (not counting the terminating null character). Otherwise, a
negative value is returned. Thus, the null-terminated output has been completely stored if and
only if the returned value is nonnegative and less than n.
The value returned by the snprintf( ) function does not include the final ’\0’ (null) character.
ERRORS
None. The snprintf( ) function does not set errno.
RELATED INFORMATION
Functions: fp_class(3), fprintf(3), isnan(3), toascii(3), putc(3), printf(3), scanf(3), sprintf(3),
vsnprintf(3).
STANDARDS CONFORMANCE
This function conforms to the UNIX98 specification.
The POSIX standards leave some features to the implementing vendor to define. The following
features are affected in the HP implementation:
The output of %p conversion is a decimal integer.
The following are HP extensions to the ISO/IEC 9899:1999 specification:
The conversion specifier L followed by a d, i, o, u, x,orX conversion specifier indicates
that the argument will be treated as a long long or an unsigned long long, which is a 64-
bit integer data type.
527187-017 Hewlett-Packard Company 681