OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib: sbi: Fix sbi_strnlen wrong count decrement
@ 2022-09-13  9:47 Rahul Pathak
  2022-09-13 10:52 ` Anup Patel
  0 siblings, 1 reply; 3+ messages in thread
From: Rahul Pathak @ 2022-09-13  9:47 UTC (permalink / raw)
  To: opensbi

count(maxlen) should not be decremented here

Fixes: 1901e8a287bc ("platform: Add minimal libc support.")
Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com>
---
 lib/sbi/sbi_string.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/sbi/sbi_string.c b/lib/sbi/sbi_string.c
index c163f3176506..9ebea693d0f6 100644
--- a/lib/sbi/sbi_string.c
+++ b/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;
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-13 11:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-13  9:47 [PATCH] lib: sbi: Fix sbi_strnlen wrong count decrement Rahul Pathak
2022-09-13 10:52 ` Anup Patel
2022-09-13 11:58   ` Anup Patel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox