From owner-freebsd-current Fri Nov 20 20:07:54 1998 Return-Path: <owner-freebsd-current@FreeBSD.ORG> Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA05360 for freebsd-current-outgoing; Fri, 20 Nov 1998 20:07:54 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA05353 for <freebsd-current@FreeBSD.ORG>; Fri, 20 Nov 1998 20:07:52 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.1/8.9.1) id UAA20321; Fri, 20 Nov 1998 20:07:22 -0800 (PST) (envelope-from dillon) Date: Fri, 20 Nov 1998 20:07:22 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> Message-Id: <199811210407.UAA20321@apollo.backplane.com> To: Archie Cobbs <archie@whistle.com> Cc: grog@lemis.com, rnordier@nordier.com, freebsd-current@FreeBSD.ORG Subject: Re: snprintf() in the kernel References: <199811210312.TAA25314@bubba.whistle.com> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :As promised, here are the patches to add [v]snprintf() to the kernel :and fix a zillion occurrences of sprintf() and str[n]cpy()... : : ftp://ftp.whistle.com/pub/archie/misc/SNPRINTF.patch.gz : :There are 124 files affected.. so reviews are much appreciated! : :Thanks, :-Archie :___________________________________________________________________________ :Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com I'll take a pass through them. The very first one has a bug... not in the snprintf(), but in the size of the buffer: static char unk[8]; int i; ... sprintf(unk, "0x%x", op); ^^^^^^ looks like up to 11 characters to me. The buffer is only 8. -Matt Matthew Dillon Engineering, HiWay Technologies, Inc. & BEST Internet Communications & God knows what else. <dillon@backplane.com> (Please include original email in any response) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message