Actions

EmSys

CCoding Style - Clarify-donot-confuse

From EdWiki

Clarify, don’t confuse

int strcmp( char* s1, char* s2)
/* string comparison routine returns –1 if s1 is above s2 in an ascending order list,
*0 if equal, 1 if s1 is below s2
*/
{
    while( *s1 == *s2 ) {
        if( *s1 == ‘\0) return 0;
	s1++;
	s2++;
    }
    if( *s1 > *s2 ) return 1;
    return1;
}