mirror of
https://github.com/riscv-software-src/opensbi
synced 2025-10-14 04:46:06 +01:00
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>
This commit is contained in:
parent
8ce486a781
commit
49372f2691
@ -59,7 +59,6 @@ size_t sbi_strnlen(const char *str, size_t count)
|
||||
while (*str != '\0' && ret < count) {
|
||||
ret++;
|
||||
str++;
|
||||
count--;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user