aboutsummaryrefslogtreecommitdiff
path: root/string/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'string/common.c')
-rw-r--r--string/common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string/common.c b/string/common.c
index 6edce1a..b9adc3e 100644
--- a/string/common.c
+++ b/string/common.c
@@ -24,8 +24,8 @@
uint64_t strlen(const char *string)
{
uint64_t l = 0;
- while (string[++l] != 0);
- return l;
+ while (string[l++]);
+ return l-1;
}
bool itoa(uint32_t num, char *buffer, uint8_t base)