Elyes Haouas has submitted this change. ( https://review.coreboot.org/c/coreboot/+/83224?usp=email )
Change subject: lib/string: use size_t for local variable in strncmp ......................................................................
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 felix-coreboot@felixheld.de Change-Id: Ibe35d3741bc6d8a16a3bad3ec27aafc30745d931 Reviewed-on: https://review.coreboot.org/c/coreboot/+/83224 Reviewed-by: Marshall Dawson marshalldawson3rd@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Matt DeVillier matt.devillier@gmail.com Reviewed-by: Elyes Haouas ehaouas@noos.fr Reviewed-by: Varshit Pandya pandyavarshit@gmail.com --- M src/lib/string.c 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Elyes Haouas: Looks good to me, approved Marshall Dawson: Looks good to me, approved Matt DeVillier: Looks good to me, approved Varshit Pandya: Looks good to me, approved
diff --git a/src/lib/string.c b/src/lib/string.c index b1996ff..a7f8074 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -115,7 +115,7 @@
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'))