summaryrefslogtreecommitdiff
path: root/concat.h
diff options
context:
space:
mode:
authorAli H. Fardan <raiz@firemail.cc>2016-09-08 04:31:49 +0300
committerAli H. Fardan <raiz@firemail.cc>2016-09-08 04:31:49 +0300
commit2afea979877ae12226ab397355f3bf8c8e124e91 (patch)
treee89ce0ec63391ff192319dcdbc93fc1a86b8a785 /concat.h
parent113979e5b8398a2c26736749480fe32b5c49a66b (diff)
used ccat() from concat.h for string concatenation
Diffstat (limited to 'concat.h')
-rw-r--r--concat.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/concat.h b/concat.h
new file mode 100644
index 0000000..7f2ea46
--- /dev/null
+++ b/concat.h
@@ -0,0 +1,19 @@
+/*
+ * Thanks to lloyd for contribution
+ */
+
+extern char concat[8192];
+
+extern void
+ccat(const unsigned short int count, ...)
+{
+ va_list ap;
+ unsigned short int i;
+ concat[0] = '\0';
+
+ va_start(ap, count);
+ for(i = 0; i < count; i++)
+ strlcat(concat, va_arg(ap, char *), sizeof(concat));
+ va_end(ap);
+ return;
+}