From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peng Fan Date: Tue, 22 Dec 2015 17:14:15 +0800 Subject: [U-Boot] [PATCH 1/1] common: nvedit: use snprintf instead of sprintf In-Reply-To: <1450775655-2979-1-git-send-email-van.freenix@gmail.com> References: <1450775655-2979-1-git-send-email-van.freenix@gmail.com> Message-ID: <1450775655-2979-3-git-send-email-van.freenix@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Peng Fan Use snprintf to replace sprintf. Signed-off-by: Peng Fan Cc: Tom Rini Cc: Simon Glass Cc: Joe Hershberger --- common/cmd_nvedit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 2f9cdd0..5ae9d9d 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -595,7 +595,7 @@ static int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, /* Set read buffer to initial value or empty sting */ init_val = getenv(argv[1]); if (init_val) - sprintf(buffer, "%s", init_val); + snprintf(buffer, CONFIG_SYS_CBSIZE, "%s", init_val); else buffer[0] = '\0'; -- 2.6.2