Skip to contentSkip to conversation

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

PATCH New Chen Gang 1 participant 1 message Mar 20, 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/snd-go7007.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/media/go7007/snd-go7007.c +3 -3
index 5af29ff..6f6271e 100644
@@ -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;
Signature · 1 line
1.7.7.6