1 #include <lib9.h> 2 3 int strcmp(char * s1,char * s2)4 strcmp(char *s1, char *s2) 5 { 6 unsigned c1, c2; 7 8 for(;;) { 9 c1 = *s1++; 10 c2 = *s2++; 11 if(c1 != c2) { 12 if(c1 > c2) 13 return 1; 14 return -1; 15 } 16 if(c1 == 0) 17 return 0; 18 } 19 } 20