Ignore:
Timestamp:
Apr 19, 2025, 8:08:37 PM (4 months ago)
Author:
David Azarewicz
Message:

Merge in changes from 6.6-LTS branch.
Fixed additional 25+ problems.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/lib32/vsprintf.c

    r32 r772  
    3232
    3333#include <stdarg.h>
    34 
     34#include <linux/kernel.h>
    3535
    3636
     
    366366}
    367367
     368/**
     369 * vscnprintf - Format a string and place it in a buffer
     370 * @buf: The buffer to place the result into
     371 * @size: The size of the buffer, including the trailing null space
     372 * @fmt: The format string to use
     373 * @args: Arguments for the format string
     374 *
     375 * The return value is the number of characters which have been written into
     376 * the @buf not including the trailing '\0'. If @size is == 0 the function
     377 * returns 0.
     378 *
     379 * If you're not already dealing with a va_list consider using scnprintf().
     380 *
     381 * See the vsnprintf() documentation for format string extensions over C99.
     382 */
     383int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
     384{
     385        int i;
     386
     387        if (unlikely(!size))
     388                return 0;
     389
     390        i = vsnprintf(buf, size, fmt, args);
     391
     392        if (likely(i < size))
     393                return i;
     394
     395        return size - 1;
     396}
Note: See TracChangeset for help on using the changeset viewer.