From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [RFC 3/8] snd-aoa: add soundbus Date: Fri, 02 Jun 2006 16:21:35 +0200 Message-ID: References: <20060601115844.343214000@sipsolutions.net> <20060601115846.852128000@sipsolutions.net> <1149257225.11092.22.camel@johannes.berg> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (ns2.suse.de [195.135.220.15]) by alsa.jcu.cz (ALSA's E-mail Delivery System) with ESMTP id 73C37160 for ; Fri, 2 Jun 2006 16:21:35 +0200 (MEST) In-Reply-To: <1149257225.11092.22.camel@johannes.berg> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: Johannes Berg Cc: linuxppc-dev@ozlabs.org, alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 02 Jun 2006 16:07:05 +0200, Johannes Berg wrote: > > On Fri, 2006-06-02 at 15:53 +0200, Takashi Iwai wrote: > > > + if (strlen(sdev->modalias)) { > > > + length = snprintf (buf, 34, "%s\n", sdev->modalias); > > > > sizeof(sdev->modalias) + 2? But still strange if modalias has no > > nul-end. > > Hm, how would I handle that if modalias has no nul? Well, I'm not sure whether modalias is always nul-terminated. If yes (I hope so), the above could be simply sprintf(). Otherwise (if not nul-terminated), I'd implement like: strlcpy(buf, sdev->modalias, sizeof(sdev->modalias) + 1); strcpy(buf, "\n"); lenth = strlen(buf); Takashi