Commit dd382b3c authored by Andrew Morton's avatar Andrew Morton Committed by Greg Kroah-Hartman

[PATCH] snprintf() commentary

From: Paul Jackson <pj@sgi.com>

Explain the snprintf() return value.
parent fd555edb
......@@ -234,6 +234,11 @@ static char * number(char * buf, char * end, unsigned long long num, int base, i
* @fmt: The format string to use
* @args: Arguments for the format string
*
* The return value is the number of characters which would be
* generated for the given input, excluding the trailing null,
* as per ISO C99. If the return is greater than or equal to
* @size, the resulting string is truncated.
*
* Call this function if you are already dealing with a va_list.
* You probably want snprintf instead.
*/
......@@ -482,6 +487,11 @@ EXPORT_SYMBOL(vsnprintf);
* @size: The size of the buffer, including the trailing null space
* @fmt: The format string to use
* @...: Arguments for the format string
*
* The return value is the number of characters which would be
* generated for the given input, excluding the trailing null,
* as per ISO C99. If the return is greater than or equal to
* @size, the resulting string is truncated.
*/
int snprintf(char * buf, size_t size, const char *fmt, ...)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment