From: "Németh Márton" <nm127@freemail.hu>
To: Mauro Carvalho Chehab <mchehab@infradead.org>,
v4L Mailing List <linux-media@vger.kernel.org>
Cc: cocci@diku.dk, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] dvb ttusb-dec: do not overwrite the first part of phys string
Date: Sat, 21 Nov 2009 17:46:12 +0100 [thread overview]
Message-ID: <4B081954.5020907@freemail.hu> (raw)
In-Reply-To: <4B079CE0.60604@freemail.hu>
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)
next prev parent reply other threads:[~2009-11-21 16:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-21 7:55 [PATCH] do not overwrite the first part of phys string Németh Márton
2009-11-21 7:55 ` Németh Márton
2009-11-21 16:46 ` Németh Márton [this message]
2009-11-23 16:08 ` Dmitry Torokhov
2009-11-23 16:08 ` Dmitry Torokhov
2009-11-23 16:11 ` Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B081954.5020907@freemail.hu \
--to=nm127@freemail.hu \
--cc=cocci@diku.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.