提交 1c3fc152 编写于 作者: C Chen Gang 提交者: Mauro Carvalho Chehab

[media] drivers/staging/media/go7007: using strlcpy instead of strncpy

for NUL terminated string, need always set 0 in the end.
Signed-off-by: NChen Gang <gang.chen@asianux.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 04e1ac04
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册