From owner-freebsd-current Fri Nov 20 22:45:27 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA16829 for freebsd-current-outgoing; Fri, 20 Nov 1998 22:45:27 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from pluto.plutotech.com (mail.plutotech.com [206.168.67.137]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA16824 for ; Fri, 20 Nov 1998 22:45:26 -0800 (PST) (envelope-from gibbs@plutotech.com) Received: from narnia.plutotech.com (narnia.plutotech.com [206.168.67.130]) by pluto.plutotech.com (8.8.7/8.8.5) with ESMTP id XAA21642; Fri, 20 Nov 1998 23:44:55 -0700 (MST) Message-Id: <199811210644.XAA21642@pluto.plutotech.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Matthew Dillon cc: "Justin T. Gibbs" , current@FreeBSD.ORG Subject: Re: snprintf() in the kernel In-reply-to: Your message of "Fri, 20 Nov 1998 22:38:16 PST." <199811210638.WAA21040@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 20 Nov 1998 23:37:35 -0700 From: "Justin T. Gibbs" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >::> >::> Boy, weren't we lucky that all BT model names were 4 characters! >:: >::Of course they are always 4 characters long. How do you think the programme >r >::determined the correct amount of space to allocate for the name information >::in the first place? >:: >::-- >::Justin > > Well, yes, but the obvious problem is that at some future point someone > adds a 5-character model and, BEWM. Which can't happen for a product line no longer being developed. I'm not saying that the changes are bad, but most kernel developers do put some thought into their design and its implications. For this very reason, most of the changes offered are for code that already functions correctly. > In general, this is why we need either snprintf()'s or very well > documented strncpy()'s. None of those strncpy()'s special 'expected' > side effects were documented at all, which is bad. They need to be > documented if they are going to remain in there. man strncpy -- Justin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message