mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 22:35:43 +01:00
modify library/net.c to use polarssl_snprintf
This commit is contained in:
parent
8f3a9436a9
commit
a18b11f285
@ -129,6 +129,12 @@ typedef UINT32 uint32_t;
|
||||
(((unsigned long )(n) & 0xFF000000) >> 24))
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_PLATFORM_C)
|
||||
#include "polarssl/platform.h"
|
||||
#else
|
||||
#define polarssl_snprintf snprintf
|
||||
#endif
|
||||
|
||||
unsigned short net_htons( unsigned short n );
|
||||
unsigned long net_htonl( unsigned long n );
|
||||
#define net_htons(n) POLARSSL_HTONS(n)
|
||||
@ -173,7 +179,7 @@ int net_connect( int *fd, const char *host, int port )
|
||||
|
||||
/* getaddrinfo expects port as a string */
|
||||
memset( port_str, 0, sizeof( port_str ) );
|
||||
snprintf( port_str, sizeof( port_str ), "%d", port );
|
||||
polarssl_snprintf( port_str, sizeof( port_str ), "%d", port );
|
||||
|
||||
/* Do name resolution with both IPv6 and IPv4, but only TCP */
|
||||
memset( &hints, 0, sizeof( hints ) );
|
||||
@ -259,7 +265,7 @@ int net_bind( int *fd, const char *bind_ip, int port )
|
||||
|
||||
/* getaddrinfo expects port as a string */
|
||||
memset( port_str, 0, sizeof( port_str ) );
|
||||
snprintf( port_str, sizeof( port_str ), "%d", port );
|
||||
polarssl_snprintf( port_str, sizeof( port_str ), "%d", port );
|
||||
|
||||
/* Bind to IPv6 and/or IPv4, but only in TCP */
|
||||
memset( &hints, 0, sizeof( hints ) );
|
||||
|
Loading…
Reference in New Issue
Block a user