mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-21 16:27:42 +00:00
Avoid uninitialized variable warning in entropy_gather_internal
The variable ret was always initialized in entropy_gather_internal, but `gcc -Werror=maybe-uninitialized` rightfully complained that it was unable to determine this statically. Therefore, tweak the problematic case (ctx->source_count == 0) to not use ret in that case.
This commit is contained in:
parent
3d98b97442
commit
b662cc1f52
|
@ -196,13 +196,11 @@ int entropy_update_manual( entropy_context *ctx,
|
||||||
*/
|
*/
|
||||||
static int entropy_gather_internal( entropy_context *ctx )
|
static int entropy_gather_internal( entropy_context *ctx )
|
||||||
{
|
{
|
||||||
int ret, i;
|
int ret = POLARSSL_ERR_ENTROPY_NO_SOURCES_DEFINED;
|
||||||
|
int i;
|
||||||
unsigned char buf[ENTROPY_MAX_GATHER];
|
unsigned char buf[ENTROPY_MAX_GATHER];
|
||||||
size_t olen;
|
size_t olen;
|
||||||
|
|
||||||
if( ctx->source_count == 0 )
|
|
||||||
return( POLARSSL_ERR_ENTROPY_NO_SOURCES_DEFINED );
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Run through our entropy sources
|
* Run through our entropy sources
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue