Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 17 Aug 2002 15:40:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 17 Aug 2002 15:40:12 -0400 Received: from pc2-cwma1-5-cust12.swa.cable.ntl.com ([80.5.121.12]:23282 "EHLO irongate.swansea.linux.org.uk") by vger.kernel.org with ESMTP id ; Sat, 17 Aug 2002 15:40:12 -0400 Subject: Re: [PATCH] 2.5.31 driverfs: patch for your consideration From: Alan Cox To: Adam Belay Cc: Patrick Mochel , Greg KH , linux-kernel@vger.kernel.org In-Reply-To: <3D5D7E50.4030307@netscape.net> References: <3D5D7E50.4030307@netscape.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.3 (1.0.3-6) Date: 17 Aug 2002 20:43:26 +0100 Message-Id: <1029613406.4647.18.camel@irongate.swansea.linux.org.uk> Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 626 Lines: 18 On Fri, 2002-08-16 at 23:36, Adam Belay wrote: > +static ssize_t device_read_driver(struct device * dev, char * buf, > size_t count, loff_t off) > +{ > + if (dev->driver) > + return off ? 0 : sprintf(buf,"%s\n",dev->driver->name); > + else > + return 0; Unless you can prove without doubt between now and the end of time the size is sufficient use snprintf - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/