Skip to content

Commit

Permalink
arch: arm: mach-msm: using strlcpy instead of strncpy
Browse files Browse the repository at this point in the history
For NULL terminated string, need always be sure of ended by zero.

Or the next 'ptr' in 'for' looping may cause issue.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: David Brown <davidb@codeaurora.org>
  • Loading branch information
Chen Gang authored and David Brown committed May 31, 2013
1 parent f722406 commit ad8c373
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/mach-msm/clock-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int __init clock_debug_add(struct clk *clock)
if (!debugfs_base)
return -ENOMEM;

strncpy(temp, clock->dbg_name, ARRAY_SIZE(temp)-1);
strlcpy(temp, clock->dbg_name, ARRAY_SIZE(temp));
for (ptr = temp; *ptr; ptr++)
*ptr = tolower(*ptr);

Expand Down

0 comments on commit ad8c373

Please sign in to comment.