From owner-freebsd-audit Mon Jul 15 4:17:25 2002 Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8E31337B400; Mon, 15 Jul 2002 04:17:23 -0700 (PDT) Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id B68BD43E31; Mon, 15 Jul 2002 04:17:22 -0700 (PDT) (envelope-from des@ofug.org) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 34E72534B; Mon, 15 Jul 2002 13:17:21 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Giorgos Keramidas Cc: Bruce Evans , freebsd-audit@FreeBSD.org Subject: Re: bin/ln & WARNS=5 References: <20020715202126.S40071-100000@gamplex.bde.org> <20020715111436.GD50130@hades.hell.gr> From: Dag-Erling Smorgrav Date: 15 Jul 2002 13:17:20 +0200 In-Reply-To: <20020715111436.GD50130@hades.hell.gr> Message-ID: Lines: 12 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Giorgos Keramidas writes: > My intuition was that size_t being unsigned won't require truncation > of the (int) return value... But if one wanted to explicitly make > both a check for (-1) and the return value being less than the size of > the buffer would the following be more proper? Looks good to me, apart from the extra parentheses around the argument to sizeof. DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message