]> pd.if.org Git - pdclib/blob - functions/string/strcmp.c
f6a555b56de7d0076c425a472466e393bec43685
[pdclib] / functions / string / strcmp.c
1 /* $Id$ */
2
3 /* Release $Name$ */
4
5 /* strcmp( const char *, const char * )
6
7    This file is part of the Public Domain C Library (PDCLib).
8    Permission is granted to use, modify, and / or redistribute at will.
9 */
10
11 int strcmp( const char * s1, const char * s2 )
12 {
13     while ( ( *s1 ) && ( *s1 == *s2 ) )
14     {
15         ++s1;
16         ++s2;
17     }
18     return ( *s1 - *s2 );
19 }
20
21 #warning Test driver missing.
22
23 #ifdef TEST
24 int main()
25 {
26     return 0;
27 }
28 #endif