From c127695e96f62f61a94e9f8227abd4b7e71c6088 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 14 Mar 1997 03:59:21 +0000 Subject: (main): Make sure c1 is not -1 before using it as an array index. Patch from Greg McGary. Although this is truly a bug, I believe it would not cause tr to misbehave on most systems. I could not construct a test case with which this bug causes tr to generate invalid output. --- src/tr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tr.c') diff --git a/src/tr.c b/src/tr.c index da9b2f381..7005ae331 100644 --- a/src/tr.c +++ b/src/tr.c @@ -2033,7 +2033,7 @@ construct in string1 must be aligned with a corresponding construct\n\ else { /* The following should have been checked by validate... */ - if (c2 == -1) + if (c1 == -1 || c2 == -1) break; xlate[c1] = c2; } -- cgit v1.2.3-54-g00ecf