Magellan Linux

Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/memcmp.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (show annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 232 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

1 /*
2 * memcmp.c
3 */
4
5 #include <string.h>
6
7 int memcmp(const void *s1, const void *s2, size_t n)
8 {
9 const unsigned char *c1 = s1, *c2 = s2;
10 int d = 0;
11
12 while (n--) {
13 d = (int)*c1++ - (int)*c2++;
14 if (d)
15 break;
16 }
17
18 return d;
19 }