Browse Source

lib: sbi: Fix sbi_strnlen wrong count decrement

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>
Rahul Pathak 1 year ago
parent
commit
49372f2691
1 changed files with 0 additions and 1 deletions
  1. 0 1
      lib/sbi/sbi_string.c

+ 0 - 1
lib/sbi/sbi_string.c

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