Skip to content

Commit

Permalink
powerpc/cell: Replace strncpy by strlcpy
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
roel kluin authored and Benjamin Herrenschmidt committed Aug 20, 2009
1 parent c5a8c0c commit 2e2ddb2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/powerpc/platforms/cell/celleb_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2e2ddb2

Please sign in to comment.