]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libc/port/strcmp.c
libregexp: improve the transition to next available thread, instruction, and generation
[plan9front.git] / sys / src / libc / port / strcmp.c
1 #include <u.h>
2 #include <libc.h>
3
4 int
5 strcmp(char *s1, char *s2)
6 {
7         unsigned c1, c2;
8
9         for(;;) {
10                 c1 = *s1++;
11                 c2 = *s2++;
12                 if(c1 != c2) {
13                         if(c1 > c2)
14                                 return 1;
15                         return -1;
16                 }
17                 if(c1 == 0)
18                         return 0;
19         }
20 }