From e7d6d472c21aa80c28be01c0d6dcbfd250d57a25 Mon Sep 17 00:00:00 2001 From: nima Date: Mon, 30 Jun 2008 12:08:58 +0000 Subject: First commit to SVN. git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@1 abc39116-655e-4be6-ad55-d661dc543056 --- catsprintf.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 catsprintf.c (limited to 'catsprintf.c') diff --git a/catsprintf.c b/catsprintf.c new file mode 100644 index 0000000..e0914c4 --- /dev/null +++ b/catsprintf.c @@ -0,0 +1,20 @@ +#include "catsprintf.h" + +int catsprintf(char *buf, const char *format, ...) { + static int i = 0; + + va_list arg; /*will point to each unnamed argument in turn*/ + va_start(arg, format); /* point to first element after fmt*/ + + + char b[8192]; + int c = vsprintf (b, format, arg); + i += strlen(b); + //printf("%d %s (%d)\n", i, b, strlen(b)); + + strcat(buf, b); + + va_end(arg); /*cleanup*/ + + return c; +} -- cgit