mirror of
https://github.com/nasa/trick.git
synced 2024-12-21 22:17:51 +00:00
2a03ff5cf4
* Replace sprintf with snprintf in all of Trick source. #1384 * Don't add -Werror for MacOS because of deprecated sprintf warnings which we cant get rid of because SWIG. #1384 * Fixed an unbalanced parenthesis in S_overrides.mk. #1384
14 lines
459 B
C++
14 lines
459 B
C++
|
|
#include "trick/VariableServer.hh"
|
|
#include "trick/variable_server_message_types.h"
|
|
#include "trick/tc_proto.h"
|
|
|
|
int Trick::VariableServerThread::write_stdio(int stream, std::string text) {
|
|
|
|
char header[16] ;
|
|
snprintf(header, sizeof(header), "%-2d %1d %8d\n" , VS_STDIO, stream , (int)text.length()) ;
|
|
tc_write(&connection , (char *) header , strlen(header)) ;
|
|
tc_write(&connection , (char *) text.c_str() , text.length()) ;
|
|
return 0 ;
|
|
}
|