source:
trunk/essentials/sys-apps/gawk/missing_d/memcmp.c
Last change on this file was 3076, checked in by , 18 years ago | |
---|---|
File size: 337 bytes |
Line | |
---|---|
1 | /* |
2 | * memcmp --- compare strings. |
3 | * |
4 | * We use our own routine since it has to act like strcmp() for return |
5 | * value, and the BSD manual says bcmp() only returns zero/non-zero. |
6 | */ |
7 | |
8 | int |
9 | memcmp (s1, s2, l) |
10 | register char *s1, *s2; |
11 | register int l; |
12 | { |
13 | for (; l-- > 0; s1++, s2++) { |
14 | if (*s1 != *s2) |
15 | return (*s1 - *s2); |
16 | } |
17 | return (0); |
18 | } |
Note:
See TracBrowser
for help on using the repository browser.