mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
- Fixed compiler warning for unreferenced ret in md_file() when POLARSSL_FS_IO not declared
This commit is contained in:
@ -177,10 +177,8 @@ void error_strerror( int ret, char *buf, size_t buflen )
|
||||
snprintf( buf, buflen, "MD - Bad input parameters to function" );
|
||||
if( use_ret == -(POLARSSL_ERR_MD_ALLOC_FAILED) )
|
||||
snprintf( buf, buflen, "MD - Failed to allocate memory" );
|
||||
if( use_ret == -(POLARSSL_ERR_MD_FILE_OPEN_FAILED) )
|
||||
snprintf( buf, buflen, "MD - Opening of file failed" );
|
||||
if( use_ret == -(POLARSSL_ERR_MD_FILE_READ_FAILED) )
|
||||
snprintf( buf, buflen, "MD - Failure when reading from file" );
|
||||
if( use_ret == -(POLARSSL_ERR_MD_FILE_IO_ERROR) )
|
||||
snprintf( buf, buflen, "MD - Opening or reading of file failed" );
|
||||
#endif /* POLARSSL_MD_C */
|
||||
|
||||
#if defined(POLARSSL_PEM_C)
|
||||
|
10
library/md.c
10
library/md.c
@ -222,19 +222,19 @@ int md( const md_info_t *md_info, const unsigned char *input, size_t ilen,
|
||||
|
||||
int md_file( const md_info_t *md_info, const char *path, unsigned char *output )
|
||||
{
|
||||
#if defined(POLARSSL_FS_IO)
|
||||
int ret;
|
||||
#endif
|
||||
|
||||
if( md_info == NULL )
|
||||
return POLARSSL_ERR_MD_BAD_INPUT_DATA;
|
||||
|
||||
#if defined(POLARSSL_FS_IO)
|
||||
ret = md_info->file_func( path, output );
|
||||
if( ret == 2 )
|
||||
return POLARSSL_ERR_MD_FILE_OPEN_FAILED;
|
||||
if( ret == 3 )
|
||||
return POLARSSL_ERR_MD_FILE_READ_FAILED;
|
||||
if( ret != 0 )
|
||||
return( POLARSSL_ERR_MD_FILE_IO_ERROR + ret );
|
||||
|
||||
return ret;
|
||||
return( ret );
|
||||
#else
|
||||
((void) path);
|
||||
((void) output);
|
||||
|
Reference in New Issue
Block a user