Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lib/vsprintf: Improve vsprintf + sprintf function comments

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

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

authored by

Thorsten Blum and committed by
Petr Mladek
2e448748 67e1b005

+4 -4
+4 -4
lib/vsprintf.c
··· 3054 3054 * @fmt: The format string to use 3055 3055 * @args: Arguments for the format string 3056 3056 * 3057 - * The function returns the number of characters written 3058 - * into @buf. Use vsnprintf() or vscnprintf() in order to avoid 3057 + * The return value is the number of characters written into @buf not including 3058 + * the trailing '\0'. Use vsnprintf() or vscnprintf() in order to avoid 3059 3059 * buffer overflows. 3060 3060 * 3061 3061 * If you're not already dealing with a va_list consider using sprintf(). ··· 3074 3074 * @fmt: The format string to use 3075 3075 * @...: Arguments for the format string 3076 3076 * 3077 - * The function returns the number of characters written 3078 - * into @buf. Use snprintf() or scnprintf() in order to avoid 3077 + * The return value is the number of characters written into @buf not including 3078 + * the trailing '\0'. Use snprintf() or scnprintf() in order to avoid 3079 3079 * buffer overflows. 3080 3080 * 3081 3081 * See the vsnprintf() documentation for format string extensions over C99.