From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Thu, 2 Jan 2014 19:23:11 -0500 To: 9fans@9fans.net Message-ID: <653d9535fd9b6f066c60313702e71d44@mikro> In-Reply-To: <83239c3d7e0996dd01d52735939ea1c8@mikro> References: <83239c3d7e0996dd01d52735939ea1c8@mikro> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] devproc noteid changing for none Topicbox-Message-UUID: abba3394-ead8-11e9-9d60-3106f5b1d025 i think the list insertion code needs a single-read test that f->alarm != 0. to prevent the 0 from acting like a fencepost. e.g. trying to insert -10 into list -40 -30 0 -20. if(alarms.head) { l = &alarms.head; for(f = *l; f; f = f->palarm) { >> fw = f->alarm; >> if(fw != 0 && (long)(fw - when) >= 0) { up->palarm = f; *l = up; goto done; } l = &f->palarm; } *l = up; } - erik