]> Pileus Git - ~andy/linux/commitdiff
V4L/DVB (13414): ttusb-dec: do not overwrite the first part of phys string
authorMárton Németh <nm127@freemail.hu>
Sat, 21 Nov 2009 16:46:12 +0000 (13:46 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 5 Dec 2009 20:41:45 +0000 (18:41 -0200)
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/ttusb-dec/ttusb_dec.c

index d91e0638448fce9adb1a25d5e0091bf5804ae3f9..53baccbab17f0bdc1c7eb5686628dd4d7d5d822d 100644 (file)
@@ -1198,7 +1198,7 @@ static int ttusb_init_rc( struct ttusb_dec *dec)
        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)