summaryrefslogtreecommitdiffstats
path: root/drivers/staging/csr/csr_formatted_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/csr/csr_formatted_io.c')
-rw-r--r--drivers/staging/csr/csr_formatted_io.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/staging/csr/csr_formatted_io.c b/drivers/staging/csr/csr_formatted_io.c
new file mode 100644
index 000000000000..bd6456bcf866
--- /dev/null
+++ b/drivers/staging/csr/csr_formatted_io.c
@@ -0,0 +1,29 @@
+/*****************************************************************************
+
+ (c) Cambridge Silicon Radio Limited 2010
+ All rights reserved and confidential information of CSR
+
+ Refer to LICENSE.txt included with this source for details
+ on the license terms.
+
+*****************************************************************************/
+
+#include "csr_types.h"
+#include "csr_formatted_io.h"
+#include "csr_util.h"
+
+CsrInt32 CsrSnprintf(CsrCharString *dest, CsrSize n, const CsrCharString *fmt, ...)
+{
+ CsrInt32 r;
+ va_list args;
+ va_start(args, fmt);
+ r = CsrVsnprintf(dest, n, fmt, args);
+ va_end(args);
+
+ if (dest && (n > 0))
+ {
+ dest[n - 1] = '\0';
+ }
+
+ return r;
+}