summaryrefslogtreecommitdiffstatshomepage
path: root/stm/string0.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-23 18:11:05 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-23 18:11:05 +0000
commitcfedd81c076a8c338a1a1b8f69008fb308e90bc8 (patch)
treecf89af8d3519c227fb3b91b13937516405f5c661 /stm/string0.c
parent26a00085fedd5e45df79314774b650811dc05bed (diff)
parentc3e72a8cc818b8777c253d4fddcf92181bf06b23 (diff)
downloadmicropython-cfedd81c076a8c338a1a1b8f69008fb308e90bc8.tar.gz
micropython-cfedd81c076a8c338a1a1b8f69008fb308e90bc8.zip
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'stm/string0.c')
-rw-r--r--stm/string0.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/stm/string0.c b/stm/string0.c
index 4899e7b0f5..79fd4cc097 100644
--- a/stm/string0.c
+++ b/stm/string0.c
@@ -34,6 +34,16 @@ void *memset(void *s, int c, size_t n) {
return s;
}
+int memcmp(const char *s1, const char *s2, size_t n) {
+ while (n--) {
+ char c1 = *s1++;
+ char c2 = *s2++;
+ if (c1 < c2) return -1;
+ else if (c1 > c2) return 1;
+ }
+ return 0;
+}
+
size_t strlen(const char *str) {
int len = 0;
for (const char *s = str; *s; s++) {