summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>1999-10-13 12:06:35 +0000
committerru <ru@FreeBSD.org>1999-10-13 12:06:35 +0000
commit29127d3b8e4417f797afe9634c4395c4db6b9f1b (patch)
tree16445c485d08092133e6cbbfde98888bb7da0ce8 /gnu
parent91e46e056dafefa81e2c3981c199d2026f5cc7c5 (diff)
downloadFreeBSD-src-29127d3b8e4417f797afe9634c4395c4db6b9f1b.zip
FreeBSD-src-29127d3b8e4417f797afe9634c4395c4db6b9f1b.tar.gz
Cast tp[-2] to unsigned char before comparing.
PR: 14011 Ignored by: maintainer Obtained from: GNU grep 2.3
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/grep/kwset.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gnu/usr.bin/grep/kwset.c b/gnu/usr.bin/grep/kwset.c
index afbeb64..68871cb 100644
--- a/gnu/usr.bin/grep/kwset.c
+++ b/gnu/usr.bin/grep/kwset.c
@@ -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)
;
OpenPOWER on IntegriCloud