]> Pileus Git - ~andy/linux/blob - drivers/staging/csr/csr_formatted_io.c
Merge branch 'fortglx/3.7/time' of git://git.linaro.org/people/jstultz/linux into...
[~andy/linux] / drivers / staging / csr / csr_formatted_io.c
1 /*****************************************************************************
2
3             (c) Cambridge Silicon Radio Limited 2010
4             All rights reserved and confidential information of CSR
5
6             Refer to LICENSE.txt included with this source for details
7             on the license terms.
8
9 *****************************************************************************/
10 #include <linux/kernel.h>
11 #include "csr_formatted_io.h"
12
13 s32 CsrSnprintf(char *dest, size_t n, const char *fmt, ...)
14 {
15     s32 r;
16     va_list args;
17     va_start(args, fmt);
18     r = vsnprintf(dest, n, fmt, args);
19     va_end(args);
20
21     if (dest && (n > 0))
22     {
23         dest[n - 1] = '\0';
24     }
25
26     return r;
27 }