From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <8688ccec5d34a086440468e150912fef@rei2.9hal> Date: Wed, 22 Aug 2012 15:31:18 +0200 From: cinap_lenrek@gmx.de To: 9fans@9fans.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] dns Topicbox-Message-UUID: adbb52a0-ead7-11e9-9d60-3106f5b1d025 i just said it like 2 times already that i think this destck() and the result serveraddrs() check is bogus and is the source of all this confustion. the "curdest" is handled as an end pointer in the rest of the code. its where you start adding stuff, and after writing it, you increment it to the next element. so it always points past the last valid element. this is just idiomatic c code. serveraddrs() should take a start index (current count) and return a count. and at the beginning check if the start index is already the maximum size of the dest array. this makes the most sense and is not hard to understand. -- cinap