Commit 143dc11a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Write CRLF in the same I/O operation

parent d5959bcc
...@@ -149,18 +149,15 @@ struct intf_sys_t ...@@ -149,18 +149,15 @@ struct intf_sys_t
static void __msg_rc( intf_thread_t *p_intf, const char *psz_fmt, ... ) static void __msg_rc( intf_thread_t *p_intf, const char *psz_fmt, ... )
{ {
va_list args; va_list args;
char fmt_eol[strlen (psz_fmt) + 3];
snprintf (fmt_eol, sizeof (fmt_eol), "%s\r\n", psz_fmt);
va_start( args, psz_fmt ); va_start( args, psz_fmt );
if( p_intf->p_sys->i_socket == -1 ) if( p_intf->p_sys->i_socket == -1 )
{ utf8_vfprintf( stdout, fmt_eol, args );
utf8_vfprintf( stdout, psz_fmt, args );
printf( "\r\n" );
}
else else
{ net_vaPrintf( p_intf, p_intf->p_sys->i_socket, NULL, fmt_eol, args );
net_vaPrintf( p_intf, p_intf->p_sys->i_socket, NULL, psz_fmt, args );
net_Write( p_intf, p_intf->p_sys->i_socket, NULL, (uint8_t*)"\r\n", 2 );
}
va_end( args ); va_end( args );
} }
......
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