All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 2/2] Staging: crystalhd: don't waste the last char of buffer
@ 2011-03-14  9:35 Dan Carpenter
  2011-03-14 20:03 ` [patch 2/2] Staging: crystalhd: don't waste the last char of Jarod Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-03-14  9:35 UTC (permalink / raw)
  To: kernel-janitors

pinfo->name is a 32 char buffer.  In the original code, the last char
wasn't fully utilized.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index 4197111..7e0c199 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -562,7 +562,7 @@ static int __devinit chd_dec_pci_probe(struct pci_dev *pdev,
 		goto err;
 	}
 
-	snprintf(pinfo->name, 31, "crystalhd_pci_e:%d:%d:%d",
+	snprintf(pinfo->name, sizeof(pinfo->name), "crystalhd_pci_e:%d:%d:%d",
 		 pdev->bus->number, PCI_SLOT(pdev->devfn),
 		 PCI_FUNC(pdev->devfn));
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-14 20:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-14  9:35 [patch 2/2] Staging: crystalhd: don't waste the last char of buffer Dan Carpenter
2011-03-14 20:03 ` [patch 2/2] Staging: crystalhd: don't waste the last char of Jarod Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.