[Alsa-devel] [RFC 3/8] snd-aoa: add soundbus
Takashi Iwai
tiwai at suse.de
Sat Jun 3 00:45:32 EST 2006
At Fri, 02 Jun 2006 16:41:14 +0200,
Andreas Schwab wrote:
>
> Takashi Iwai <tiwai at suse.de> writes:
>
> > 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 modalias is not nul-terminated then strlen will already fail.
Oh yes. It should be simply
if (*sdev->modalias) {
...
> > Otherwise (if not nul-terminated), I'd implement like:
> >
> > strlcpy(buf, sdev->modalias, sizeof(sdev->modalias) + 1);
> > strcpy(buf, "\n");
>
> strcat?
Argh, yes.
Takashi
More information about the Linuxppc-dev
mailing list