mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-14 21:10:27 +01:00
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>
This commit is contained in:
parent
c71630838d
commit
8b9cc866c1
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue