mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 15:51:41 +01:00
lib: sbi: Fix sbi_strnlen wrong count decrement
count(maxlen) should not be decremented here
Fixes: 1901e8a287
("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:
@@ -59,7 +59,6 @@ size_t sbi_strnlen(const char *str, size_t count)
|
|||||||
while (*str != '\0' && ret < count) {
|
while (*str != '\0' && ret < count) {
|
||||||
ret++;
|
ret++;
|
||||||
str++;
|
str++;
|
||||||
count--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user