From: Chen Gang Date: Wed, 20 Mar 2013 02:26:09 +0000 (-0300) Subject: [media] drivers/staging/media/go7007: using strlcpy instead of strncpy X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1c3fc152b8ebadd59814767e3189c961b73f20c8;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [media] drivers/staging/media/go7007: using strlcpy instead of strncpy for NUL terminated string, need always set 0 in the end. Signed-off-by: Chen Gang Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/staging/media/go7007/snd-go7007.c b/drivers/staging/media/go7007/snd-go7007.c index 5af29ff68bfd..6f6271ec558c 100644 --- a/drivers/staging/media/go7007/snd-go7007.c +++ b/drivers/staging/media/go7007/snd-go7007.c @@ -267,9 +267,9 @@ int go7007_snd_init(struct go7007 *go) kfree(gosnd); return ret; } - strncpy(gosnd->card->driver, "go7007", sizeof(gosnd->card->driver)); - strncpy(gosnd->card->shortname, go->name, sizeof(gosnd->card->driver)); - strncpy(gosnd->card->longname, gosnd->card->shortname, + strlcpy(gosnd->card->driver, "go7007", sizeof(gosnd->card->driver)); + strlcpy(gosnd->card->shortname, go->name, sizeof(gosnd->card->driver)); + strlcpy(gosnd->card->longname, gosnd->card->shortname, sizeof(gosnd->card->longname)); gosnd->pcm->private_data = go;