From: Christian Weisgerber Subject: Re: deltify addblk() fixes To: gameoftrees@openbsd.org Date: Fri, 11 Jun 2021 21:49:18 +0200 Stefan Sperling: > > There's no point in reading a block until we know that we need to > > compare it. The "if (r == 0)" part should move under the following > > if. > > Yes, that makes sense. This patch implemenents your suggestion. > if (len == dt->blocks[i].len && h == dt->blocks[i].hash) { > + uint8_t buf[GOT_DELTIFY_MAXCHUNK]; I think that is wrong. The lifetime of an automatic object is the _block_ where it is declared. -- Christian "naddy" Weisgerber naddy@mips.inka.de