diff mbox

[U-Boot] cmd_md5sum.c: remove dead code / fix warning

Message ID 1402870242-11090-1-git-send-email-jeroen@myspectrum.nl
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Jeroen Hofstee June 15, 2014, 10:10 p.m. UTC
commit ecd729500 "Add parameter to md5sum to save the md5 sum"
adds support to build a string to be saved in the env and tries
to zero end it with str_ptr = '\0'; This does actually set the
pointer to the end of the buffer itself to zero. Since the
string was already zero terminated by the sprintf before it,
just remove the line, preventing a clang warning.

cc: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
---
 common/cmd_md5sum.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Tom Rini June 19, 2014, 3:23 p.m. UTC | #1
On Mon, Jun 16, 2014 at 12:10:42AM +0200, Jeroen Hofstee wrote:

> commit ecd729500 "Add parameter to md5sum to save the md5 sum"
> adds support to build a string to be saved in the env and tries
> to zero end it with str_ptr = '\0'; This does actually set the
> pointer to the end of the buffer itself to zero. Since the
> string was already zero terminated by the sprintf before it,
> just remove the line, preventing a clang warning.
> 
> cc: Joe Hershberger <joe.hershberger@ni.com>
> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/common/cmd_md5sum.c b/common/cmd_md5sum.c
index ae0f62e..3ac8cc4 100644
--- a/common/cmd_md5sum.c
+++ b/common/cmd_md5sum.c
@@ -33,7 +33,6 @@  static void store_result(const u8 *sum, const char *dest)
 			sprintf(str_ptr, "%02x", sum[i]);
 			str_ptr += 2;
 		}
-		str_ptr = '\0';
 		setenv(dest, str_output);
 	}
 }