BSD 4_4_Lite2 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Fri, 28 Jun 1991 11:20:46 +0000 (03:20 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Fri, 28 Jun 1991 11:20:46 +0000 (03:20 -0800)
Work on file usr/src/contrib/gawk-2.15.2/missing/memcmp.c

Synthesized-from: CSRG/cd3/4.4BSD-Lite2

usr/src/contrib/gawk-2.15.2/missing/memcmp.c [new file with mode: 0644]

diff --git a/usr/src/contrib/gawk-2.15.2/missing/memcmp.c b/usr/src/contrib/gawk-2.15.2/missing/memcmp.c
new file mode 100644 (file)
index 0000000..63cb5f8
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * memcmp --- compare strings.
+ *
+ * We use our own routine since it has to act like strcmp() for return
+ * value, and the BSD manual says bcmp() only returns zero/non-zero.
+ */
+
+int
+memcmp (s1, s2, l)
+register char *s1, *s2;
+register int l;
+{
+       for (; l-- > 0; s1++, s2++) {
+               if (*s1 != *s2)
+                       return (*s1 - *s2);
+       }
+       return (0);
+}