summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2010-08-04 03:43:55 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-08-06 19:09:38 +0200
commitdfcdce8eec30d61743cefa0edc001a79bc3e29d6 (patch)
treea5709dc2cebb61ed6a514bc8f9c7f525d4b57097 /lib
parente0953c5db2cb2ac73ca4ffe2f91ee78939de4ede (diff)
downloadbarebox-dfcdce8eec30d61743cefa0edc001a79bc3e29d6.tar.gz
barebox-dfcdce8eec30d61743cefa0edc001a79bc3e29d6.tar.xz
arm: add common clkdev
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Andrea GALLO <andrea.gallo@stericsson.com> Cc: Gael SALLES <gael.salles@stericsson.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/vsprintf.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 91ad613c70..6066845c5b 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -515,6 +515,31 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
EXPORT_SYMBOL(vsnprintf);
/**
+ * vscnprintf - Format a string and place it in a buffer
+ * @buf: The buffer to place the result into
+ * @size: The size of the buffer, including the trailing null space
+ * @fmt: The format string to use
+ * @args: Arguments for the format string
+ *
+ * The return value is the number of characters which have been written into
+ * the @buf not including the trailing '\0'. If @size is <= 0 the function
+ * returns 0.
+ *
+ * Call this function if you are already dealing with a va_list.
+ * You probably want scnprintf() instead.
+ *
+ * See the vsnprintf() documentation for format string extensions over C99.
+ */
+int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
+{
+ int i;
+
+ i=vsnprintf(buf,size,fmt,args);
+ return (i >= size) ? (size - 1) : i;
+}
+EXPORT_SYMBOL(vscnprintf);
+
+/**
* vsprintf - Format a string and place it in a buffer
* @buf: The buffer to place the result into
* @fmt: The format string to use