From 502b41ff96be4a33f90a617b1b6c4908973e8c25 Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Fri, 20 Nov 2015 16:14:14 +0100 Subject: [PATCH] Build debug string by consecutive calls to XPLMDebugString snprintf was not supported by MSVC for a very long time. It got added the first time in MSVC 2015. To be able to build libxplanemp with earlier versions, don't use snprintf but just pass the debug message in multiple consecutive calls to XPLMDebugString. --- src/xbus/libxplanemp/src/XPMPMultiplayerObj.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/xbus/libxplanemp/src/XPMPMultiplayerObj.cpp b/src/xbus/libxplanemp/src/XPMPMultiplayerObj.cpp index 0aa050dbc..945c8cf55 100644 --- a/src/xbus/libxplanemp/src/XPMPMultiplayerObj.cpp +++ b/src/xbus/libxplanemp/src/XPMPMultiplayerObj.cpp @@ -347,10 +347,11 @@ int OBJ_LoadModel(const char * inFilePath) tex_path += ".png"; sObjects.back().texnum = OBJ_LoadTexture(tex_path.c_str(), false); if(sObjects.back().texnum == 0) { - char debug[500]; - snprintf(debug, 500, "WARNING: %s failed to load for %s.\n", tex_path.c_str(),inFilePath); - debug[499] = '\0'; - XPLMDebugString(debug); + XPLMDebugString("WARNING: "); + XPLMDebugString(tex_path.c_str()); + XPLMDebugString(" failed to load for "); + XPLMDebugString(inFilePath); + XPLMDebugString("\n"); } tex_path = path;