From 99e24cd99a5701c820a787351f512601cb5b69b2 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sun, 17 May 2020 19:30:04 +0200 Subject: [PATCH] mescc: Mes C Library: Prepare for M2-Planet: strlen. * lib/string/strlen.c: : Rewrite C-constructs not supported by M2-Planet. --- lib/string/strlen.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/string/strlen.c b/lib/string/strlen.c index 3ce75ef7..303bf479 100644 --- a/lib/string/strlen.c +++ b/lib/string/strlen.c @@ -1,6 +1,6 @@ /* -*-comment-start: "//";comment-end:""-*- * GNU Mes --- Maxwell Equations of Software - * Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen + * Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen * * This file is part of GNU Mes. * @@ -24,7 +24,9 @@ size_t strlen (char const *s) { int i = 0; - while (s[i]) - i++; + + while (s[i] != 0) + i = i + 1; + return i; }