mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-21 21:36:21 +01:00
Check additional return values in some test cases
This commit is contained in:
parent
94b916c7b5
commit
8a0c0a9ed9
3 changed files with 13 additions and 3 deletions
|
|
@ -146,7 +146,12 @@ int main( int argc, char *argv[] )
|
|||
printf( " failed\n ! fopen returned NULL\n" );
|
||||
goto exit;
|
||||
}
|
||||
fgets( buf, sizeof(buf), f );
|
||||
if( fgets( buf, sizeof(buf), f ) == NULL )
|
||||
{
|
||||
fclose( f );
|
||||
printf( "Error: fgets() failed to retrieve password\n" );
|
||||
goto exit;
|
||||
}
|
||||
fclose( f );
|
||||
|
||||
i = (int) strlen( buf );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue