From 3697ec5ca140f686643d204a54181a5ddbf9a799 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 15 Jul 2010 23:12:49 +0300 Subject: Moved to gawk 2.11. --- missing.d/memcmp.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 missing.d/memcmp.c (limited to 'missing.d/memcmp.c') diff --git a/missing.d/memcmp.c b/missing.d/memcmp.c new file mode 100644 index 00000000..e39c10ec --- /dev/null +++ b/missing.d/memcmp.c @@ -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--; s1++, s2++) { + if (*s1 != *s2) + return (*s1 - *s2); + } + return (*--s1 - *--s2); +} -- cgit v1.2.3