Commit 9d31c406 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Save a call to strlen() in net_vaPrintf (and net_Printf)

parent 42e52150
...@@ -584,7 +584,7 @@ void net_ListenClose( int *pi_fd ) ...@@ -584,7 +584,7 @@ void net_ListenClose( int *pi_fd )
* __net_Read: * __net_Read:
***************************************************************************** *****************************************************************************
* Read from a network socket * Read from a network socket
* If b_rety is true, then we repeat until we have read the right amount of * If b_retry is true, then we repeat until we have read the right amount of
* data * data
*****************************************************************************/ *****************************************************************************/
int __net_Read( vlc_object_t *p_this, int fd, v_socket_t *p_vs, int __net_Read( vlc_object_t *p_this, int fd, v_socket_t *p_vs,
...@@ -952,8 +952,7 @@ int __net_vaPrintf( vlc_object_t *p_this, int fd, v_socket_t *p_vs, ...@@ -952,8 +952,7 @@ int __net_vaPrintf( vlc_object_t *p_this, int fd, v_socket_t *p_vs,
char *psz; char *psz;
int i_size, i_ret; int i_size, i_ret;
vasprintf( &psz, psz_fmt, args ); i_size = vasprintf( &psz, psz_fmt, args );
i_size = strlen( psz );
i_ret = __net_Write( p_this, fd, p_vs, (uint8_t *)psz, i_size ) < i_size i_ret = __net_Write( p_this, fd, p_vs, (uint8_t *)psz, i_size ) < i_size
? -1 : i_size; ? -1 : i_size;
free( psz ); free( psz );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment