From 015b86d725e33a221b89d93cbd0700980c7b75bf Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Thu, 2 Oct 2008 20:12:34 +0000 Subject: 2008-10-02 Jeff Johnston * libc/string/str-two-way.h (critical_factorization): Cast the index operation to ensure unsigned rollover occurs when adding to SIZE_MAX. --- newlib/libc/string/str-two-way.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'newlib/libc/string/str-two-way.h') diff --git a/newlib/libc/string/str-two-way.h b/newlib/libc/string/str-two-way.h index ad71a2595..72b60c39c 100644 --- a/newlib/libc/string/str-two-way.h +++ b/newlib/libc/string/str-two-way.h @@ -114,7 +114,7 @@ critical_factorization (const unsigned char *needle, size_t needle_len, while (j + k < needle_len) { a = CANON_ELEMENT (needle[j + k]); - b = CANON_ELEMENT (needle[max_suffix + k]); + b = CANON_ELEMENT (needle[(size_t)(max_suffix + k)]); if (a < b) { /* Suffix is smaller, period is entire prefix so far. */ -- cgit v1.2.3