From 21ce0f403064f30712355bfda3a8f2a97bc4b4e3 Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Fri, 24 Mar 2017 10:59:48 +0800 Subject: [PATCH] examples/nvme: replace sprintf with snprintf Change-Id: I08c594e26df9e1cdae67596e92db646c92701f85 Signed-off-by: Ziye Yang --- examples/nvme/hello_world/hello_world.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nvme/hello_world/hello_world.c b/examples/nvme/hello_world/hello_world.c index 81d04decb..66e83c450 100644 --- a/examples/nvme/hello_world/hello_world.c +++ b/examples/nvme/hello_world/hello_world.c @@ -181,7 +181,7 @@ hello_world(void) * 0 on the namespace, and then later read it back into a separate buffer * to demonstrate the full I/O path. */ - sprintf(sequence.buf, "Hello world!\n"); + snprintf(sequence.buf, 0x1000, "%s", "Hello world!\n"); /* * Write the data buffer to LBA 0 of this namespace. "write_complete" and