Commit 2e448748 authored by Thorsten Blum's avatar Thorsten Blum Committed by Petr Mladek
Browse files

lib/vsprintf: Improve vsprintf + sprintf function comments



Clarify that the return values of vsprintf() and sprintf() exclude the
trailing NUL character.

Signed-off-by: default avatarThorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20251103090913.2066-2-thorsten.blum@linux.dev


Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
parent 67e1b005
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -3054,8 +3054,8 @@ EXPORT_SYMBOL(scnprintf);
 * @fmt: The format string to use
 * @args: Arguments for the format string
 *
 * The function returns the number of characters written
 * into @buf. Use vsnprintf() or vscnprintf() in order to avoid
 * The return value is the number of characters written into @buf not including
 * the trailing '\0'. Use vsnprintf() or vscnprintf() in order to avoid
 * buffer overflows.
 *
 * If you're not already dealing with a va_list consider using sprintf().
@@ -3074,8 +3074,8 @@ EXPORT_SYMBOL(vsprintf);
 * @fmt: The format string to use
 * @...: Arguments for the format string
 *
 * The function returns the number of characters written
 * into @buf. Use snprintf() or scnprintf() in order to avoid
 * The return value is the number of characters written into @buf not including
 * the trailing '\0'. Use snprintf() or scnprintf() in order to avoid
 * buffer overflows.
 *
 * See the vsnprintf() documentation for format string extensions over C99.