summaryrefslogtreecommitdiffstats
path: root/src/winmain/qtmain_winrt.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2018-02-08 14:09:14 +0100
committerOliver Wolff <oliver.wolff@qt.io>2018-03-07 13:38:44 +0000
commitb33a8cb13d317cc5a5212204966b2e174d0ebca1 (patch)
tree82c076863d7f2f34e2f129e37ccdaeafcee38868 /src/winmain/qtmain_winrt.cpp
parent59e9c4956cfc5163c1fc411c6c567a4c753b4e9a (diff)
winrt: Add null pointer to the end of the arguments array
Although WinRT doesn't officially support argc/argv, respect C++03 ยง3.6.1/2 (The value of argv[argc] shall be 0). Task-number: QTCREATORBUG-19705 Change-Id: I190e2923b8a0665cc8975a800619fd916a4dd244 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src/winmain/qtmain_winrt.cpp')
-rw-r--r--src/winmain/qtmain_winrt.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/winmain/qtmain_winrt.cpp b/src/winmain/qtmain_winrt.cpp
index 79ecf30b70..21aed27c7f 100644
--- a/src/winmain/qtmain_winrt.cpp
+++ b/src/winmain/qtmain_winrt.cpp
@@ -157,7 +157,7 @@ public:
mainThread = CreateThread(NULL, 0, [](void *param) -> DWORD {
AppContainer *app = reinterpret_cast<AppContainer *>(param);
- int argc = app->args.count();
+ int argc = app->args.count() - 1;
char **argv = app->args.data();
const int res = main(argc, argv);
if (app->pidFile != INVALID_HANDLE_VALUE) {
@@ -305,6 +305,8 @@ private:
args.remove(i);
}
}
+ args.append(nullptr);
+
if (develMode) {
// Write a PID file to help runner
const QString pidFileName = QDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation))