"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Mark Jamsek <mark@jamsek.com>
Subject:
Re: two more dead stores in tog/tog.c
To:
Florian Obser <florian@narrans.de>, gameoftrees <gameoftrees@openbsd.org>
Date:
Fri, 22 Jul 2022 13:18:55 +1000

Download raw body.

Thread
On 22-07-21 10:28pm, Stefan Sperling wrote:
> On Thu, Jul 21, 2022 at 07:09:23PM +0200, Florian Obser wrote:
> > scan-build reports two more dead stores in tog/tog.c where I don't know
> > what to do about.
> > 
> > No idea what this does, should there be only one call to
> > offset_selection_down()? or are there simply two
> > 	if (err)
> > 		return err;
> > missing?
> > 
> >   1206		if (v->mode == TOG_VIEW_SPLIT_HRZN) {
> >   1207			err = offset_selection_down(v);
> >   1208			err = offset_selection_down(v->child);
> >   1209		} else {
> 
> To me this looks like two missing error checks.
> In the else clause, we run the corresponding _up functions for
> both v and v->child as well.

Yes, Stefan is correct: it's two missing error checks.  I committed this
mistake recently when changing the behaviour of the 'S' key map.  The
second call is needed when switching to a hsplit because we need to
scroll down to offset selections in the child view too.

Thanks, Florian!

-- 
Mark Jamsek <fnc.bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68