mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 17:25:38 +00:00
Fix MSVC warning in sample programs
The warning was caused because of conversions from size_t to int, which can cause data loss. The files affected are: * ssl_client2.c * ssl_server2.c * ssl_mail_client.c
This commit is contained in:
parent
7d661f83e1
commit
2d0a5840fe
|
@ -1267,7 +1267,7 @@ send_request:
|
|||
|
||||
len = polarssl_snprintf( (char *) buf, sizeof(buf) - 1, GET_REQUEST,
|
||||
opt.request_page );
|
||||
tail_len = strlen( GET_REQUEST_END );
|
||||
tail_len = (int) strlen( GET_REQUEST_END );
|
||||
|
||||
/* Add padding to GET request to reach opt.request_size in length */
|
||||
if( opt.request_size != DFL_REQUEST_SIZE &&
|
||||
|
|
|
@ -57,8 +57,8 @@
|
|||
#include <unistd.h>
|
||||
#else
|
||||
#include <io.h>
|
||||
#define read _read
|
||||
#define write _write
|
||||
#define read(fd, buf, len) _read( fd, (void *)buf, (unsigned int)len )
|
||||
#define write(fd, buf, len) _write( fd, (const void *)buf, (unsigned int)len )
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN32_WCE)
|
||||
|
|
|
@ -1791,7 +1791,7 @@ data_exchange:
|
|||
unsigned char *larger_buf;
|
||||
|
||||
ori_len = ret;
|
||||
extra_len = ssl_get_bytes_avail( &ssl );
|
||||
extra_len = (int) ssl_get_bytes_avail( &ssl );
|
||||
|
||||
larger_buf = polarssl_malloc( ori_len + extra_len + 1 );
|
||||
if( larger_buf == NULL )
|
||||
|
|
Loading…
Reference in a new issue