diff options
Diffstat (limited to 'src/target/firmware/lib/strcmp.c')
-rw-r--r-- | src/target/firmware/lib/strcmp.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/target/firmware/lib/strcmp.c b/src/target/firmware/lib/strcmp.c new file mode 100644 index 00000000..9a7fa818 --- /dev/null +++ b/src/target/firmware/lib/strcmp.c @@ -0,0 +1,12 @@ +/* + * Compare strings: s1>s2: >0 s1==s2: 0 s1<s2: <0 + */ + +strcmp(s1, s2) + register char *s1, *s2; +{ + while (*s1 == *s2++) + if (*s1++=='\0') + return(0); + return(*s1 - *--s2); +} |