aboutsummaryrefslogtreecommitdiff
path: root/djb/str_diffn.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_diffn.c
bulk upload of source
Diffstat (limited to 'djb/str_diffn.c')
-rw-r--r--djb/str_diffn.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/djb/str_diffn.c b/djb/str_diffn.c
new file mode 100644
index 0000000..934040f
--- /dev/null
+++ b/djb/str_diffn.c
@@ -0,0 +1,11 @@
+int str_diffn(const char* a, const char* b, unsigned int limit) /*EXTRACT_INCL*/ {
+ unsigned int u=0;
+ char ch=0;
+
+ for (; u<limit; u++) {
+ ch = a[u] - b[u];
+ if (ch) break;
+ if (a[u]==0) break;
+ }
+ return ch;
+}