Cast tp[-2] to unsigned char before comparing.

PR:		14011
Ignored by:	maintainer
Obtained from:	GNU grep 2.3
This commit is contained in:
Ruslan Ermilov 1999-10-13 12:06:35 +00:00
parent a7461766f5
commit a4e449c8a3
1 changed files with 3 additions and 1 deletions

View File

@ -27,6 +27,8 @@
String Matching: An Aid to Bibliographic Search," CACM June 1975,
Vol. 18, No. 6, which describes the failure function used below. */
/* $FreeBSD$ */
#ifdef STDC_HEADERS
#include <limits.h>
@ -591,7 +593,7 @@ bmexec(kws, text, size)
d = d1[U((tp += d)[-1])];
if (d != 0)
continue;
if (tp[-2] == gc)
if (U(tp[-2]) == gc)
{
for (i = 3; i <= len && U(tp[-i]) == U(sp[-i]); ++i)
;