summaryrefslogtreecommitdiffstats
path: root/catsprintf.c
diff options
context:
space:
mode:
authornima <nima@abc39116-655e-4be6-ad55-d661dc543056>2008-06-30 12:08:58 +0000
committernima <nima@abc39116-655e-4be6-ad55-d661dc543056>2008-06-30 12:08:58 +0000
commite7d6d472c21aa80c28be01c0d6dcbfd250d57a25 (patch)
tree04d9d76a9a48f183f4cdf1c922a8e33555e77da1 /catsprintf.c
downloadpython-dmidecode-e7d6d472c21aa80c28be01c0d6dcbfd250d57a25.tar.gz
python-dmidecode-e7d6d472c21aa80c28be01c0d6dcbfd250d57a25.tar.xz
python-dmidecode-e7d6d472c21aa80c28be01c0d6dcbfd250d57a25.zip
First commit to SVN.
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@1 abc39116-655e-4be6-ad55-d661dc543056
Diffstat (limited to 'catsprintf.c')
-rw-r--r--catsprintf.c20
1 files changed, 20 insertions, 0 deletions
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;
+}