lib: sbi: Fix sbi_strnlen wrong count decrement
authorRahul Pathak <rpathak@ventanamicro.com>
Tue, 13 Sep 2022 09:47:08 +0000 (15:17 +0530)
committerAnup Patel <anup@brainfault.org>
Tue, 13 Sep 2022 11:47:10 +0000 (17:17 +0530)
count(maxlen) should not be decremented here

Fixes: 1901e8a287bc ("platform: Add minimal libc support.")
Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/sbi/sbi_string.c

index c163f31..9ebea69 100644 (file)
@@ -59,7 +59,6 @@ size_t sbi_strnlen(const char *str, size_t count)
        while (*str != '\0' && ret < count) {
                ret++;
                str++;
-               count--;
        }
 
        return ret;