[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <51A2BC3B.4040908@asianux.com>
Date: Mon, 27 May 2013 09:51:55 +0800
From: Chen Gang <gang.chen@...anux.com>
To: Mike Frysinger <vapier@...too.org>,
Paul Mundt <lethal@...ux-sh.org>,
realmz paranoid <realmz6@...il.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>, monstr@...str.eu,
"uclinux-dist-devel@...ckfin.uclinux.org"
<uclinux-dist-devel@...ckfin.uclinux.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Linux-Arch <linux-arch@...r.kernel.org>
Subject: [PATCH v2] arch: blackfin: kernel: using strlcpy() instead of strncpy()
For NULL terminated string, need always be sure of ended by zero.
Just use strlcpy() instead of strncpy().
Signed-off-by: Chen Gang <gang.chen@...anux.com>
---
arch/blackfin/kernel/setup.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 107b306..c731ec7 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -1458,5 +1458,5 @@ void __init cmdline_init(const char *r0)
{
early_shadow_stamp();
if (r0)
- strncpy(command_line, r0, COMMAND_LINE_SIZE);
+ strlcpy(command_line, r0, COMMAND_LINE_SIZE);
}
--
1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists