From a3dc6c0d352d07c2e36595d3bd54c94e6898ace6 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Wed, 26 Jun 2024 20:29:59 +0200 Subject: lib/string: use size_t for local variable in strncmp Since the 'maxlen' parameter's type is changed to size_t, the type of the local variable 'i' which this is compared against should also be changed to size_t. Signed-off-by: Felix Held Change-Id: Ibe35d3741bc6d8a16a3bad3ec27aafc30745d931 Reviewed-on: https://review.coreboot.org/c/coreboot/+/83224 Reviewed-by: Marshall Dawson Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier Reviewed-by: Elyes Haouas Reviewed-by: Varshit Pandya --- src/lib/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/string.c b/src/lib/string.c index b1996ff103..a7f8074fc7 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -115,7 +115,7 @@ int strcmp(const char *s1, const char *s2) int strncmp(const char *s1, const char *s2, size_t maxlen) { - int i; + size_t i; for (i = 0; i < maxlen; i++) { if ((s1[i] != s2[i]) || (s1[i] == '\0')) -- cgit v1.2.3