mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 11:35:40 +00:00
Merge remote-tracking branch 'upstream/pr/2983' into baremetal
* upstream/pr/2983: Fix mbedtls_strerror to work with all wanted codes
This commit is contained in:
commit
28ecfb002f
|
@ -224,9 +224,9 @@ void mbedtls_strerror( int ret, char *buf, size_t buflen )
|
|||
if( ret < 0 )
|
||||
ret = -ret;
|
||||
|
||||
if( ret & 0xFF80 )
|
||||
if( ret & 0xFFFF80 )
|
||||
{
|
||||
use_ret = ret & 0xFF80;
|
||||
use_ret = ret & 0xFFFF80;
|
||||
|
||||
// High level error codes
|
||||
//
|
||||
|
@ -580,7 +580,7 @@ void mbedtls_strerror( int ret, char *buf, size_t buflen )
|
|||
mbedtls_snprintf( buf, buflen, "UNKNOWN ERROR CODE (%04X)", use_ret );
|
||||
}
|
||||
|
||||
use_ret = ret & ~0xFF80;
|
||||
use_ret = ret & ~0xFFFF80;
|
||||
|
||||
if( use_ret == 0 )
|
||||
return;
|
||||
|
|
|
@ -57,9 +57,9 @@ void mbedtls_strerror( int ret, char *buf, size_t buflen )
|
|||
if( ret < 0 )
|
||||
ret = -ret;
|
||||
|
||||
if( ret & 0xFF80 )
|
||||
if( ret & 0xFFFF80 )
|
||||
{
|
||||
use_ret = ret & 0xFF80;
|
||||
use_ret = ret & 0xFFFF80;
|
||||
|
||||
// High level error codes
|
||||
//
|
||||
|
@ -71,7 +71,7 @@ HIGH_LEVEL_CODE_CHECKS
|
|||
mbedtls_snprintf( buf, buflen, "UNKNOWN ERROR CODE (%04X)", use_ret );
|
||||
}
|
||||
|
||||
use_ret = ret & ~0xFF80;
|
||||
use_ret = ret & ~0xFFFF80;
|
||||
|
||||
if( use_ret == 0 )
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue