X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrcmp.c;h=f6a555b56de7d0076c425a472466e393bec43685;hb=ba5eff8dd9b426485e1559b5d6204692d155d9e8;hp=e72e3761bf78a260f77e4037f8a81580c0e2abe8;hpb=419762f3c5da2a601e3c7427e25ae01293a73223;p=pdclib diff --git a/functions/string/strcmp.c b/functions/string/strcmp.c index e72e376..f6a555b 100644 --- a/functions/string/strcmp.c +++ b/functions/string/strcmp.c @@ -1,16 +1,28 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* $Id$ */ -int strcmp( const char * src_1, const char * src_2 ) +/* Release $Name$ */ + +/* strcmp( const char *, const char * ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +int strcmp( const char * s1, const char * s2 ) { - while ( ( *src_1 != '\0' ) && ( *src_1 == *src_2 ) ) + while ( ( *s1 ) && ( *s1 == *s2 ) ) { - ++src_1; - ++src_2; + ++s1; + ++s2; } - return ( *src_1 - *src_2 ); + return ( *s1 - *s2 ); +} + +#warning Test driver missing. + +#ifdef TEST +int main() +{ + return 0; } +#endif