summaryrefslogtreecommitdiff
path: root/tools/lib/vsprintf.c
blob: 45f9a06daa560251cae5c93b2cdc1624930b1460 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#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;
}
.git/diff/?id=f2557779e1a9cfbf69c99b74da26cc1b2b10e752&id2=030305d69fc6963c16003f50d7e8d74b02d0a143'>Diffstat (limited to 'sound/soc/bcm')