Skip to content

Commit

Permalink
Fix c_str omissions in error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeans289 committed Apr 19, 2023
1 parent 69388b0 commit 8c384fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ void Trick::VariableServerSession::log_message(const std::string& msg) {
}

if (_debug >= 3) {
message_publish(MSG_DEBUG, "%p tag=<%s> var_server received bytes = msg_len = %d\n", _connection, _connection->getClientTag(), msg.size());
message_publish(MSG_DEBUG, "%p tag=<%s> var_server received bytes = msg_len = %d\n", _connection, _connection->getClientTag().c_str(), msg.size());
}

if (_debug >= 1 || _info_msg) {
message_publish(MSG_DEBUG, "tag=<%s> time=%f %s", _connection->getClientTag(), exec_get_sim_time(), msg.c_str());
message_publish(MSG_DEBUG, "tag=<%s> time=%f %s", _connection->getClientTag().c_str(), exec_get_sim_time(), msg.c_str());
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ int Trick::VariableServerSession::var_exists(std::string in_name) {
buf1[4] = (error==false);

if (_debug >= 2) {
message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending 1 binary byte\n", _connection, _connection->getClientTag());
message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending 1 binary byte\n", _connection, _connection->getClientTag().c_str());
}

_connection->write(buf1, 5);
} else {
/* send ascii "1" or "0" */
sprintf(buf1, "%d\t%d\n", VS_VAR_EXISTS, (error==false));
if (_debug >= 2) {
message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending:\n%s\n", _connection, _connection->getClientTag(), buf1) ;
message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending:\n%s\n", _connection, _connection->getClientTag().c_str(), buf1) ;
}
std::string write_string(buf1);
if (write_string.length() != strlen(buf1)) {
Expand Down

0 comments on commit 8c384fb

Please sign in to comment.