Revision 07d9a380680d1c0eb51ef87ff2eab5c994949e69 authored by Linus Torvalds on 24 October 2016, 00:10:14 UTC, committed by Linus Torvalds on 24 October 2016, 00:10:14 UTC
1 parent 5ff93ab
Raw File
vsprintf.c
#include <sys/types.h>
#include <linux/kernel.h>
#include <stdio.h>

int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
{
       int i = vsnprintf(buf, size, fmt, args);
       ssize_t ssize = size;

       return (i >= ssize) ? (ssize - 1) : i;
}

int scnprintf(char * buf, size_t size, const char * fmt, ...)
{
       ssize_t ssize = size;
       va_list args;
       int i;

       va_start(args, fmt);
       i = vsnprintf(buf, size, fmt, args);
       va_end(args);

       return (i >= ssize) ? (ssize - 1) : i;
}
back to top