forked from Mirrors/opensbi
		
	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) {
 | 
			
		||||
		ret++;
 | 
			
		||||
		str++;
 | 
			
		||||
		count--;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return ret;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user