提交 ad8c373c 编写于 作者: C Chen Gang 提交者: David Brown

arch: arm: mach-msm: using strlcpy instead of strncpy

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: NChen Gang <gang.chen@asianux.com>
Signed-off-by: NDavid Brown <davidb@codeaurora.org>
上级 f722406f
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册