aboutsummaryrefslogtreecommitdiff
path: root/djb/str_diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'djb/str_diff.c')
-rw-r--r--djb/str_diff.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/djb/str_diff.c b/djb/str_diff.c
new file mode 100644
index 0000000..2c5ba59
--- /dev/null
+++ b/djb/str_diff.c
@@ -0,0 +1,11 @@
+int str_diff(const char* a, const char* b) /*EXTRACT_INCL*/ {
+ unsigned int u=0;
+ char ch=0;
+ for (;; u++) {
+ ch = a[u]-b[u];
+ if (ch) break;
+ if (a[u]==0) break;
+ }
+ return ch;
+}
+