powerpc/cell: Replace strncpy by strlcpy
authorroel kluin <roel.kluin@gmail.com>
Tue, 21 Jul 2009 00:17:17 +0000 (00:17 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 20 Aug 2009 00:12:29 +0000 (10:12 +1000)
Replace strncpy() and explicit null-termination by strlcpy()

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/cell/celleb_setup.c

index 07c234f6b2b686835f0de343a4a06522094da94f..e53845579770fc6d259c979e74ba8d1b573b171c 100644 (file)
@@ -80,8 +80,7 @@ static void celleb_show_cpuinfo(struct seq_file *m)
 
 static int __init celleb_machine_type_hack(char *ptr)
 {
-       strncpy(celleb_machine_type, ptr, sizeof(celleb_machine_type));
-       celleb_machine_type[sizeof(celleb_machine_type)-1] = 0;
+       strlcpy(celleb_machine_type, ptr, sizeof(celleb_machine_type));
        return 0;
 }