From: Stefan Sperling Subject: Re: two more dead stores in tog/tog.c To: Mark Jamsek Cc: Florian Obser , gameoftrees Date: Fri, 29 Jul 2022 12:54:08 +0200 On Fri, Jul 22, 2022 at 01:18:55PM +1000, Mark Jamsek wrote: > 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! Since Florian did not send a patch, I have fixed these problems now. Thanks again for spotting these errors, Florian!