aboutsummaryrefslogtreecommitdiff
path: root/djb/fmt_str.c
diff options
context:
space:
mode:
authorKlaatu <[email protected]>2015-05-17 15:33:21 +1200
committerKlaatu <[email protected]>2015-05-17 15:33:21 +1200
commitb0de699679e8f1e39af847ed172d1ba605b4370c (patch)
tree01dac00471d61f727394e508c613b29cff0ceae5 /djb/fmt_str.c
bulk upload of source
Diffstat (limited to 'djb/fmt_str.c')
-rw-r--r--djb/fmt_str.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/djb/fmt_str.c b/djb/fmt_str.c
new file mode 100644
index 0000000..3843311
--- /dev/null
+++ b/djb/fmt_str.c
@@ -0,0 +1,8 @@
+unsigned int fmt_str(char *s, const char *t) /*EXTRACT_INCL*/ {
+ register unsigned int len;
+ char ch;
+ len = 0;
+ if (s) { while ((ch = t[len])) s[len++] = ch; }
+ else while (t[len]) len++;
+ return len;
+}