From owner-freebsd-chat Mon Jul 20 02:28:17 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA14171 for freebsd-chat-outgoing; Mon, 20 Jul 1998 02:28:17 -0700 (PDT) (envelope-from owner-freebsd-chat@FreeBSD.ORG) Received: from freefall.pipeline.ch (intranet.pipeline.ch [195.134.128.66]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA14166 for ; Mon, 20 Jul 1998 02:28:15 -0700 (PDT) (envelope-from andre@pipeline.ch) Received: from pipeline.ch ([195.134.128.41]) by freefall.pipeline.ch (Netscape Mail Server v2.02) with ESMTP id AAA195; Mon, 20 Jul 1998 11:26:47 +0200 Message-ID: <35B30D5C.D0D0B8E2@pipeline.ch> Date: Mon, 20 Jul 1998 11:26:52 +0200 From: "IBS / Andre Oppermann" Organization: Internet Business Solutions Ltd. (AG) X-Mailer: Mozilla 4.03 [en] (WinNT; U) MIME-Version: 1.0 To: Jos Backus CC: chat@FreeBSD.ORG Subject: Re: Let's close the door to "stack hacks" References: <199807171948.NAA19746@lariat.lariat.org> <19980720105847.A2509@mpn.cp.philips.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Jos Backus wrote: > > As an aside, I believe this is one of the reasons Dan Bernstein (of qmail > fame) uses his own routines to do file/char/string/memops instead of those > provided by libc. Yea, but it's really hard to read it in the beginning. He uses always a structure containing the data and the length. All return values are checked, at least 70% of the 'if' statements are for error checking. Sometimes he does really fancy things with it; eg. he builds up a 'structure' with "string1"NULL"string2"NULL"string3" and the length of it. First he does "x = structure" to assign the first part of the 'structure' and after that he scans for NULL until he reaches the end indicated by length. This works and is perfectly legal in C, but a little bit obfuscated and very hard to read and understand (and he doesn't comment his code). BTW, he had won the 'Best of Show award' of the 'International Obfuscated C Code Contest' back in 1991. I think he hasn't really recovered from that... (http://reality.sgi.com/csp/ioccc/years.html#1991_brnstnd) BTW, the 1998 contest is looking for judges, I think the FreeBSD community has enough high profile C jugglers to get the whole contest... ;-) In case you are interested, mailto judges@toad.com. (http://reality.sgi.com/csp/ioccc/news/24jun98.html) -- Andre Oppermann CEO / Geschaeftsfuehrer Internet Business Solutions Ltd. (AG) Hardstrasse 235, 8005 Zurich, Switzerland Fon +41 1 277 75 75 / Fax +41 1 277 75 77 http://www.pipeline.ch ibs@pipeline.ch To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message