Skip to content

Commit

Permalink
[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: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Chen Gang authored and Mauro Carvalho Chehab committed Mar 25, 2013
1 parent 70f31c9 commit 136d9f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/media/go7007/saa7134-go7007.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ static int saa7134_go7007_init(struct saa7134_dev *dev)

go->board_id = GO7007_BOARDID_PCI_VOYAGER;
snprintf(go->bus_info, sizeof(go->bus_info), "PCI:%s", pci_name(dev->pci));
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;
Expand Down

0 comments on commit 136d9f3

Please sign in to comment.