1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

Fix code styling for return statements

This commit is contained in:
Paul Bakker
2014-06-17 14:06:49 +02:00
parent 3c38f29a61
commit d8bb82665e
27 changed files with 256 additions and 256 deletions

View File

@ -718,7 +718,7 @@ static int compat_snprintf(char *str, size_t size, const char *format, ...)
if ( res < 0 )
return( (int) size + 20 );
return res;
return( res );
}
#define snprintf compat_snprintf
@ -726,18 +726,18 @@ static int compat_snprintf(char *str, size_t size, const char *format, ...)
#define POLARSSL_ERR_DEBUG_BUF_TOO_SMALL -2
#define SAFE_SNPRINTF() \
{ \
if( ret == -1 ) \
return( -1 ); \
\
if ( (unsigned int) ret > n ) { \
p[n - 1] = '\0'; \
return POLARSSL_ERR_DEBUG_BUF_TOO_SMALL;\
} \
\
n -= (unsigned int) ret; \
p += (unsigned int) ret; \
#define SAFE_SNPRINTF() \
{ \
if( ret == -1 ) \
return( -1 ); \
\
if ( (unsigned int) ret > n ) { \
p[n - 1] = '\0'; \
return( POLARSSL_ERR_DEBUG_BUF_TOO_SMALL ); \
} \
\
n -= (unsigned int) ret; \
p += (unsigned int) ret; \
}
/*
@ -890,7 +890,7 @@ int x509_key_size_helper( char *buf, size_t size, const char *name )
int ret;
if( strlen( name ) + sizeof( " key size" ) > size )
return POLARSSL_ERR_DEBUG_BUF_TOO_SMALL;
return( POLARSSL_ERR_DEBUG_BUF_TOO_SMALL );
ret = snprintf( p, n, "%s key size", name );
SAFE_SNPRINTF();