aboutsummaryrefslogtreecommitdiff
path: root/djb/str_copyn.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/str_copyn.c
bulk upload of source
Diffstat (limited to 'djb/str_copyn.c')
-rw-r--r--djb/str_copyn.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/djb/str_copyn.c b/djb/str_copyn.c
new file mode 100644
index 0000000..3dab724
--- /dev/null
+++ b/djb/str_copyn.c
@@ -0,0 +1,6 @@
+unsigned int str_copyn(char *out,const char *in, unsigned int len) /*EXTRACT_INCL*/ {
+ unsigned int k=0;
+ while (k<len && (out[k]=in[k])) k++;
+ if (k<len) out[k] = 0;
+ return k;
+}