diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-11-12 17:48:26 -0800 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-11-12 17:48:48 -0800 |
commit | 47f9e06fc2c696dfb1054d730cde888f1ac75d07 (patch) | |
tree | 29e15e824e6d774cfe06e3520933ae8f5e743396 /pk/string.c | |
parent | 9cc6732d806b4a7e4842528606fa1390e7ab0a90 (diff) | |
download | riscv-pk-47f9e06fc2c696dfb1054d730cde888f1ac75d07.zip riscv-pk-47f9e06fc2c696dfb1054d730cde888f1ac75d07.tar.gz riscv-pk-47f9e06fc2c696dfb1054d730cde888f1ac75d07.tar.bz2 |
Read and use devicetree -- THIS BREAKS ROCKET FOR NOW
Diffstat (limited to 'pk/string.c')
-rw-r--r-- | pk/string.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pk/string.c b/pk/string.c index b1b9abc..e896379 100644 --- a/pk/string.c +++ b/pk/string.c @@ -45,6 +45,18 @@ size_t strlen(const char *s) return p - s; } +int strcmp(const char* s1, const char* s2) +{ + unsigned char c1, c2; + + do { + c1 = *s1++; + c2 = *s2++; + } while (c1 != 0 && c1 == c2); + + return c1 - c2; +} + char* strcpy(char* dest, const char* src) { char* d = dest; |