public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dvb ttusb-dec: do not overwrite the first part of phys string
       [not found] <4B079CE0.60604@freemail.hu>
@ 2009-11-21 16:46 ` Németh Márton
  0 siblings, 0 replies; only message in thread
From: Németh Márton @ 2009-11-21 16:46 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, v4L Mailing List; +Cc: cocci, LKML

From: Márton Németh <nm127@freemail.hu>

Use strlcat() to append a string to the previously created first part.

The semantic match that finds this kind of problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression dev;
expression phys;
expression str;
expression size;
@@
 	usb_make_path(dev, phys, size);
-	strlcpy(phys, str, size);
+	strlcat(phys, str, size);
// </smpl>

Signed-off-by: Márton Németh <nm127@freemail.hu>
---
diff -u -p a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2009-09-10 00:13:59.000000000 +0200
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2009-11-21 17:30:10.000000000 +0100
@@ -1198,7 +1198,7 @@ static int ttusb_init_rc( struct ttusb_d
 	int err;

 	usb_make_path(dec->udev, dec->rc_phys, sizeof(dec->rc_phys));
-	strlcpy(dec->rc_phys, "/input0", sizeof(dec->rc_phys));
+	strlcat(dec->rc_phys, "/input0", sizeof(dec->rc_phys));

 	input_dev = input_allocate_device();
 	if (!input_dev)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-21 16:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4B079CE0.60604@freemail.hu>
2009-11-21 16:46 ` [PATCH] dvb ttusb-dec: do not overwrite the first part of phys string Németh Márton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox