diff --git a/xpcPlugin/DataManager.cpp b/xpcPlugin/DataManager.cpp index 23a07b5..42048e5 100644 --- a/xpcPlugin/DataManager.cpp +++ b/xpcPlugin/DataManager.cpp @@ -313,12 +313,12 @@ namespace XPC } if (!xdref) // DREF does not exist { - Log::FormatLine(LOG_ERROR, "DMAN", "ERROR: invalid DREF %s", dref); + Log::FormatLine(LOG_ERROR, "DMAN", "ERROR: invalid DREF %s", dref.c_str()); return 0; } XPLMDataTypeID dataType = XPLMGetDataRefTypes(xdref); - Log::FormatLine(LOG_INFO, "DMAN", "Get DREF %s (x:%X) Type: %i", dref, xdref, dataType); + Log::FormatLine(LOG_INFO, "DMAN", "Get DREF %s (x:%X) Type: %i", dref.c_str(), xdref, dataType); // XPLMDataTypeID is a bit flag, so it may contain more than one of the // following types. We prefer types as close to float as possible. if ((dataType & 2) == 2) // Float @@ -518,7 +518,7 @@ namespace XPC if (!xdref) { // DREF does not exist - Log::FormatLine(LOG_ERROR, "DMAN", "ERROR: invalid DREF %s", dref); + Log::FormatLine(LOG_ERROR, "DMAN", "ERROR: invalid DREF %s", dref.c_str()); return; } if (isnan(values[0])) diff --git a/xpcPlugin/Message.cpp b/xpcPlugin/Message.cpp index bcc5db5..897dda4 100644 --- a/xpcPlugin/Message.cpp +++ b/xpcPlugin/Message.cpp @@ -121,7 +121,7 @@ namespace XPC { Log::WriteLine(LOG_DEBUG, "DBUG", ss.str()); std::string dref((char*)buffer + 6, buffer[5]); - Log::FormatLine(LOG_DEBUG, "DBUG", " DREF (size %i) = %s", dref.length(), dref); + Log::FormatLine(LOG_DEBUG, "DBUG", " DREF (size %i) = %s", dref.length(), dref.c_str()); ss.str(""); int values = buffer[6 + buffer[5]]; ss << " Values(size " << values << ") ="; @@ -140,7 +140,7 @@ namespace XPC { std::string dref((char*)buffer + cur + 1, buffer[cur]); Log::FormatLine(LOG_DEBUG, "DBUG", " #%i/%i (size:%i) %s", - i + 1, buffer[5], dref.length(), dref); + i + 1, buffer[5], dref.length(), dref.c_str()); cur += 1 + buffer[cur]; } break; diff --git a/xpcPlugin/MessageHandlers.cpp b/xpcPlugin/MessageHandlers.cpp index 4f7c3d3..d72b8a8 100644 --- a/xpcPlugin/MessageHandlers.cpp +++ b/xpcPlugin/MessageHandlers.cpp @@ -89,7 +89,7 @@ namespace XPC // Set current connection sockaddr sourceaddr = msg.GetSource(); connectionKey = UDPSocket::GetHost(&sourceaddr); - Log::FormatLine(LOG_INFO, "MSGH", "Handling message from %s", connectionKey); + Log::FormatLine(LOG_INFO, "MSGH", "Handling message from %s", connectionKey.c_str()); std::map::iterator conn = connections.find(connectionKey); if (conn == connections.end()) // New connection { @@ -102,13 +102,13 @@ namespace XPC connection.getdCount = 0; connections[connectionKey] = connection; Log::FormatLine(LOG_DEBUG, "MSGH", "New connection. ID=%u, Remote=%s", - connection.id, connectionKey); + connection.id, connectionKey.c_str()); } else { connection = (*conn).second; Log::FormatLine(LOG_DEBUG, "MSGH", "Existing connection. ID=%u, Remote=%s", - connection.id, connectionKey); + connection.id, connectionKey.c_str()); } msg.PrintToLog(); @@ -417,7 +417,7 @@ namespace XPC pos += 4 * valueCount; DataManager::Set(dref, values, valueCount); - Log::FormatLine(LOG_DEBUG, "DREF", "Set %d values for %s", valueCount, dref); + Log::FormatLine(LOG_DEBUG, "DREF", "Set %d values for %s", valueCount, dref.c_str()); } if (pos != size) {