Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/modules/klibc/strcmp.c

Source at commit 1292 created 12 years 8 months ago.
By meklort, Add additional functions to klibc. Remove duplicates from libsa
1/*
2 * strcmp.c
3 */
4
5#include <string.h>
6
7int strcmp(const char *s1, const char *s2)
8{
9const unsigned char *c1 = (const unsigned char *)s1;
10const unsigned char *c2 = (const unsigned char *)s2;
11unsigned char ch;
12int d = 0;
13
14while (1) {
15d = (int)(ch = *c1++) - (int)*c2++;
16if (d || !ch)
17break;
18}
19
20return d;
21}
22

Archive Download this file

Revision: 1292