Thread (32 messages) flat view 32 messages, 3 authors, 2006-06-07

Re: [Alsa-devel] [RFC 3/8] snd-aoa: add soundbus

From: Andreas Schwab <hidden>
Date: 2006-06-02 14:41:19
Also in: alsa-devel

Takashi Iwai [off-list ref] writes:
At Fri, 02 Jun 2006 16:07:05 +0200,
Johannes Berg wrote:
quoted
On Fri, 2006-06-02 at 15:53 +0200, Takashi Iwai wrote:
quoted
quoted
+	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.
Otherwise (if not nul-terminated), I'd implement like:

	strlcpy(buf, sdev->modalias, sizeof(sdev->modalias) + 1);
	strcpy(buf, "\n");
strcat?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help