linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen Gang <gang.chen@asianux.com>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	linux-media@vger.kernel.org,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>
Subject: [PATCH] drivers/staging/media/go7007: using strlcpy instead of strncpy
Date: Mon, 25 Mar 2013 11:22:17 +0800	[thread overview]
Message-ID: <514FC2E9.9090300@asianux.com> (raw)


  for NUL terminated string, need always set '\0' in the end.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 drivers/staging/media/go7007/saa7134-go7007.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/media/go7007/saa7134-go7007.c b/drivers/staging/media/go7007/saa7134-go7007.c
index cf7c34a..2d1c6c2 100644
--- a/drivers/staging/media/go7007/saa7134-go7007.c
+++ b/drivers/staging/media/go7007/saa7134-go7007.c
@@ -456,7 +456,7 @@ static int saa7134_go7007_init(struct saa7134_dev *dev)
 	if (go == NULL)
 		goto allocfail;
 	go->board_id = GO7007_BOARDID_PCI_VOYAGER;
-	strncpy(go->name, saa7134_boards[dev->board].name, sizeof(go->name));
+	strlcpy(go->name, saa7134_boards[dev->board].name, sizeof(go->name));
 	go->hpi_ops = &saa7134_go7007_hpi_ops;
 	go->hpi_context = saa;
 	saa->dev = dev;
-- 
1.7.7.6

             reply	other threads:[~2013-03-25  3:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25  3:22 Chen Gang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-03-20  3:51 [PATCH] drivers/staging/media/go7007: using strlcpy instead of strncpy Chen Gang
2013-03-20  3:26 Chen Gang

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=514FC2E9.9090300@asianux.com \
    --to=gang.chen@asianux.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).