]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (7924): ivtv/cx18: snprintf fixes
authorJean Delvare <khali@linux-fr.org>
Tue, 13 May 2008 21:27:15 +0000 (18:27 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 20 Jul 2008 10:06:37 +0000 (07:06 -0300)
snprinf() takes the trailing \0 into account in its length calculations,
so there is no need to subtract 1 to the buffer size.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/cx18/cx18-driver.c
drivers/media/video/ivtv/ivtv-driver.c

index 2b810bb2a4c70f8d37fc40b6ed5646d1ce5e308f..d9178843e8d2f152d602e777e0cdc38255300806 100644 (file)
@@ -614,7 +614,7 @@ static int __devinit cx18_probe(struct pci_dev *dev,
        cx18_cards[cx18_cards_active] = cx;
        cx->dev = dev;
        cx->num = cx18_cards_active++;
-       snprintf(cx->name, sizeof(cx->name) - 1, "cx18-%d", cx->num);
+       snprintf(cx->name, sizeof(cx->name), "cx18-%d", cx->num);
        CX18_INFO("Initializing card #%d\n", cx->num);
 
        spin_unlock(&cx18_cards_lock);
index 797e636771da07a38bc7025130a681371a09312f..bbe92d9dce36a2fb4a90f9ccc863a372808b8c38 100644 (file)
@@ -1019,7 +1019,7 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
        ivtv_cards[ivtv_cards_active] = itv;
        itv->dev = dev;
        itv->num = ivtv_cards_active++;
-       snprintf(itv->name, sizeof(itv->name) - 1, "ivtv%d", itv->num);
+       snprintf(itv->name, sizeof(itv->name), "ivtv%d", itv->num);
        IVTV_INFO("Initializing card #%d\n", itv->num);
 
        spin_unlock(&ivtv_cards_lock);