Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/strcmp.c
Parent Directory | Revision Log
Revision 532 -
(show annotations)
(download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 8 months ago) by niro
File MIME type: text/plain
File size: 320 byte(s)
Sat Sep 1 22:45:15 2007 UTC (16 years, 8 months ago) by niro
File MIME type: text/plain
File size: 320 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 | * strcmp.c |
3 | */ |
4 | |
5 | #include <string.h> |
6 | |
7 | int strcmp(const char *s1, const char *s2) |
8 | { |
9 | const unsigned char *c1 = (const unsigned char *)s1; |
10 | const unsigned char *c2 = (const unsigned char *)s2; |
11 | unsigned char ch; |
12 | int d = 0; |
13 | |
14 | while (1) { |
15 | d = (int)(ch = *c1++) - (int)*c2++; |
16 | if (d || !ch) |
17 | break; |
18 | } |
19 | |
20 | return d; |
21 | } |