Skip to content

Commit

Permalink
[media] drivers/staging/media/go7007: using strlcpy instead of strncpy
Browse files Browse the repository at this point in the history
for NUL terminated string, need always set 0 in the end.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Chen Gang authored and Mauro Carvalho Chehab committed Mar 23, 2013
1 parent 04e1ac0 commit 1c3fc15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/media/go7007/snd-go7007.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1c3fc15

Please sign in to comment.