comparison target-utils/libc/strcmp.c @ 87:7fb62fc724dc

target-utils/libc: beginning of newlib-ectomy
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 28 Oct 2016 22:20:26 +0000
parents
children
comparison
equal deleted inserted replaced
86:684eddecbc62 87:7fb62fc724dc
1 /*
2 * Compare strings: s1>s2: >0 s1==s2: 0 s1<s2: <0
3 */
4
5 strcmp(s1, s2)
6 register char *s1, *s2;
7 {
8 while (*s1 == *s2++)
9 if (*s1++=='\0')
10 return(0);
11 return(*s1 - *--s2);
12 }