diff options
author | Jeroen Hofstee <jeroen@myspectrum.nl> | 2014-06-09 11:02:02 +0200 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-06-11 16:27:05 -0400 |
commit | 8b9cc866c10787b057b4ac91c8783cfa752f1151 (patch) | |
tree | 4a9462b59d188da3ba7d3133a385b38c9f8dddb2 /common | |
parent | c71630838d908e410ee83f0164327e1fd515f1ca (diff) | |
download | u-boot-imx-8b9cc866c10787b057b4ac91c8783cfa752f1151.zip u-boot-imx-8b9cc866c10787b057b4ac91c8783cfa752f1151.tar.gz u-boot-imx-8b9cc866c10787b057b4ac91c8783cfa752f1151.tar.bz2 |
common: hash: zero end the string instead of the pointer
if algo->digest_size is zero nothing is set in the str_output
buffer. An attempt is made to zero end the buffer, but the
pointer to the buffer is set to zero instead. I am unaware if
it causes any actual problems, but solves the following warning:
common/hash.c:217:13: warning: expression which evaluates to zero treated as
a null pointer constant of type 'char *' [-Wnon-literal-null-conversion]
str_ptr = '\0';
^~~~
cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Diffstat (limited to 'common')
-rw-r--r-- | common/hash.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/hash.c b/common/hash.c index 41a4a28..237bd04 100644 --- a/common/hash.c +++ b/common/hash.c @@ -214,7 +214,7 @@ static void store_result(struct hash_algo *algo, const u8 *sum, sprintf(str_ptr, "%02x", sum[i]); str_ptr += 2; } - str_ptr = '\0'; + *str_ptr = '\0'; setenv(dest, str_output); } else { ulong addr; |