瀏覽代碼

powerpc/cell: Replace strncpy by strlcpy

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>
roel kluin 16 年之前
父節點
當前提交
2e2ddb24d3
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      arch/powerpc/platforms/cell/celleb_setup.c

+ 1 - 2
arch/powerpc/platforms/cell/celleb_setup.c

@@ -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;
 }