[media] drivers/staging/media/go7007: using strlcpy instead of strncpy
authorChen Gang <gang.chen@asianux.com>
Wed, 20 Mar 2013 02:26:09 +0000 (23:26 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 23 Mar 2013 13:37:18 +0000 (10:37 -0300)
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>
drivers/staging/media/go7007/snd-go7007.c

index 5af29ff68bfd6d2b5504222fb9d5dcd143fb77c2..6f6271ec558cb3c43c55b647fb679c9a4b851845 100644 (file)
@@ -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;