From ae5ce81d7f0ea34f1df2ef11f7b313bfefb42c8f Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Sat, 14 Jun 2014 21:54:20 +0100 Subject: [PATCH] refs #248 fixed a GCC warning --- src/xbus/utils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xbus/utils.h b/src/xbus/utils.h index 713bb97f6..8232f390a 100644 --- a/src/xbus/utils.h +++ b/src/xbus/utils.h @@ -85,6 +85,8 @@ class QSharedApplication : public QApplication m_weakptr = ptr; } + static char *strdup(const char *s) { auto s2 = static_cast(std::malloc(std::strlen(s))); return std::strcpy(s2, s); } + public: /*! * Returns a shared pointer to the QApplication. @@ -97,7 +99,7 @@ public: if (! instance()) { static int argc = 1; - static char *argv[] = { "X-Plane" }; + static char *argv[] = { strdup("X-Plane") }; new QSharedApplication(ptr, argc, argv); } if (! instance()->inherits("QSharedApplication"))