Last change
on this file since b8080f6 was f40a309, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Unix line breaks.
|
-
Property mode
set to
100644
|
File size:
537 bytes
|
Rev | Line | |
---|
[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | memcmp.c -- compare memory areas
|
---|
| 4 | Version 2 -- 1987-06-15
|
---|
| 5 |
|
---|
| 6 | Compare n bytes: s1>s2: >0 s1==s2: 0 s1<s2: <0
|
---|
| 7 | =============================================================================
|
---|
| 8 | */
|
---|
| 9 |
|
---|
| 10 | int
|
---|
| 11 | memcmp(s1, s2, n)
|
---|
| 12 | register char *s1, *s2;
|
---|
| 13 | register int n;
|
---|
| 14 | {
|
---|
| 15 | register int diff;
|
---|
| 16 |
|
---|
| 17 | if (s1 != s2)
|
---|
| 18 | while (--n >= 0)
|
---|
| 19 | if (diff = *s1++ - *s2++)
|
---|
| 20 | return(diff);
|
---|
| 21 | return(0);
|
---|
| 22 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.