From owner-freebsd-questions@FreeBSD.ORG Tue Oct 20 22:20:59 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4C781065672 for ; Tue, 20 Oct 2009 22:20:59 +0000 (UTC) (envelope-from kline@thought.org) Received: from aristotle.thought.org (aristotle.thought.org [209.180.213.210]) by mx1.freebsd.org (Postfix) with ESMTP id 7409C8FC15 for ; Tue, 20 Oct 2009 22:20:59 +0000 (UTC) Received: from thought.org (tao.thought.org [10.47.0.250]) (authenticated bits=0) by aristotle.thought.org (8.14.2/8.14.2) with ESMTP id n9KMKg9Y041886; Tue, 20 Oct 2009 15:20:43 -0700 (PDT) (envelope-from kline@thought.org) Received: by thought.org (nbSMTP-1.00) for uid 1002 kline@thought.org; Tue, 20 Oct 2009 15:20:50 -0700 (PDT) Date: Tue, 20 Oct 2009 15:20:50 -0700 From: Gary Kline To: Polytropon Message-ID: <20091020222049.GB17456@thought.org> References: <20091019013337.GA9522@thought.org> <4ADBFDBA.6040702@pchotshots.com> <20091019170634.GA12371@thought.org> <4ADCAB4F.5040707@mahan.org> <20091020054241.ce4a38fe.freebsd@edvax.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091020054241.ce4a38fe.freebsd@edvax.de> User-Agent: Mutt/1.4.2.3i X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: With 23 years of service to the Unix community. X-Spam-Status: No, score=-4.4 required=3.6 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on aristotle.thought.org Cc: FreeBSD Mailing List , Patrick Mahan Subject: Re: need C help, passing char buffer[] by-value.... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 22:20:59 -0000 On Tue, Oct 20, 2009 at 05:42:41AM +0200, Polytropon wrote: > Just a little and quite formal side note: > > On Mon, 19 Oct 2009 11:09:19 -0700, Patrick Mahan wrote: > > while (*tp != '\0' && *tp++ != '<'); > > It's often a good choice, especially for increasing readability > of code, to code the "empty statement" on a line on its own (as > you usually put any statements on an own line for clarity), so > the reader doesn't accidentally take it as and "end of command" > notification, e. g. > > while(1) > ; > > instead of > > while(1); > > which could be confused with the syntactical meaning of > > whatsthis(1); > > I'm just mentioning this because I saw this in a programming > project when I was at university. A young programmer who was > given the task to look at code a very skilled programmer gave > him. Somewhere in the code, an endless loop caused the program > not to work properly. The student could not find this endless > loop because it was coded in the manner as given above. It was > not the polite form of for(;;); :-) yeah; i already fixed this in the pointer version that patrick suggested. that's the one nice thing about perl; you gotta use braces even for a single clause. if foo { } while bar { } can't get away with while (); :-) gary > > > > > -- > Polytropon > Magdeburg, Germany > Happy FreeBSD user since 4.0 > Andra moi ennepe, Mousa, ... > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" -- Gary Kline kline@thought.org http://www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org The 7.31a release of Jottings: http://jottings.thought.org/index.php