From: Gisle Aas Date: Wed, 28 Dec 2005 10:57:46 +0000 (+0000) Subject: Fix 2 off-by-one errors in the call to ninstr(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ad07e1310bf8286a17223f4f5f7abcb6926d9c81;p=p5sagit%2Fp5-mst-13.2.git Fix 2 off-by-one errors in the call to ninstr(). This code managed to still work because of a bug in how ninstr() treats empty search strings. p4raw-id: //depot/perl@26509 --- diff --git a/ext/Filter/Util/Call/Call.xs b/ext/Filter/Util/Call/Call.xs index 05fe95f..f3344dc 100644 --- a/ext/Filter/Util/Call/Call.xs +++ b/ext/Filter/Util/Call/Call.xs @@ -85,7 +85,7 @@ filter_call(pTHX_ int idx, SV *buf_sv, int maxlen) } else { /* want lines */ - if ((p = ninstr(out_ptr, out_ptr + n - 1, nl, nl))) { + if ((p = ninstr(out_ptr, out_ptr + n, nl, nl + 1))) { sv_catpvn(buf_sv, out_ptr, p - out_ptr + 1);