From owner-freebsd-audit Mon Jul 15 10:39:20 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 AED4737B427; Mon, 15 Jul 2002 10:39:17 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id A5CA343E6E; Mon, 15 Jul 2002 10:39:16 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.3/8.12.3) with ESMTP id g6FH9b1f007845; Mon, 15 Jul 2002 11:09:39 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 15 Jul 2002 11:09:11 -0600 (MDT) Message-Id: <20020715.110911.124380985.imp@bsdimp.com> To: mike@FreeBSD.ORG Cc: keramida@FreeBSD.ORG, bde@zeta.org.au, des@ofug.org, freebsd-audit@FreeBSD.ORG Subject: Re: bin/ln & WARNS=5 From: "M. Warner Losh" In-Reply-To: <20020715121958.D64412@espresso.q9media.com> References: <20020715111436.GD50130@hades.hell.gr> <20020715.090420.83279095.imp@bsdimp.com> <20020715121958.D64412@espresso.q9media.com> X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 In message: <20020715121958.D64412@espresso.q9media.com> Mike Barcroft writes: : > The code was right before. However, maybe the following is better and : > clearer: : > : > if (strlen(source) + strlen(p) + 1 >= PATH_MAX) { : > ... ETOOLONG stuff : > } : > snprintf(...); : : You might just as well use sprintf() at this point. sprintf is considered harmful, and using snprintf specifically shows that you've 'fixed' that and it doesn't need to be 'audited'. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message