Skip to contentSkip to conversation

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

PATCH New Chen Gang 1 participant 1 message Mar 25, 2013

Subsystems (2)
lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 drivers/staging/media/go7007: using strlcpy instead of strncpy

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

---
 drivers/staging/media/go7007/saa7134-go7007.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/media/go7007/saa7134-go7007.c +1 -1
index cf7c34a..2d1c6c2 100644
@@ -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;
Signature · 1 line
1.7.7.6