Re: [PATCH] diff.c: increment buffer pointer in all code path
- From
Jeff King <peff@peff.net>
- Date
- Oct 19, 2017, 19:55 UTC
- Message-ID
- <20171019195552.sg7su63a4qqwa4v5@sigill.intra.peff.net>
- In-Reply-To
- <CAGZ79kbRFVd=hbc4DCrdkOJ4aUE_g1_NhMbG-tfPGnOJikf1GA@mail.gmail.com>
On Thu, Oct 19, 2017 at 12:53:03PM -0700, Stefan Beller wrote:
Show 14 quoted lines
> > @@ -771,7 +771,7 @@ static unsigned get_string_hash(struct emitted_diff_symbol *es, struct diff_opti
> > {
> > if (o->xdl_opts & XDF_WHITESPACE_FLAGS) {
> > static struct strbuf sb = STRBUF_INIT;
> > - const char *ap = es->line, *ae = es->line + es->len;
> > + const char *ap = es->line, *ae = es->line + es->len - 1;
> > int c;
> >
> > strbuf_reset(&sb);
> >
> > it does. It just adjusts our "end pointer" to point to the last valid
> > character in the string (rather than one past),
>
> Thanks for spotting. I can send a proper patch with tests if you'd like.I'm putting the finishing touches on a series that should be out in a few minutes. Hold off until then.
-Peff