From 4d9d83a9c1e2f13bee0be1305c4b10749bea24ed Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 29 Sep 2022 15:26:52 +0200 Subject: Fix a few compile warnings --- src/xsession.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/xsession.cpp') diff --git a/src/xsession.cpp b/src/xsession.cpp index 5db3b11..dcc9d22 100644 --- a/src/xsession.cpp +++ b/src/xsession.cpp @@ -128,7 +128,7 @@ QString XSession::checkCanRunInternal() const { if (fi.isFile() && fi.isExecutable()) return QString(); // Not found - return QObject::trUtf8("Binary %1 not found.").arg(exe); + return QObject::tr("Binary %1 not found.").arg(exe); } bool XSession::isLocked() const { @@ -175,8 +175,9 @@ void XSession::run() const { command += exec_; qDebug() << "Running via /bin/sh:" << command; QByteArray cmdbin = command.toUtf8(); - char *argv[4] = { "/bin/sh", "-c", cmdbin.data(), nullptr }; + char * const argv[4] = { strdup("/bin/sh"), strdup("-c"), cmdbin.data(), nullptr }; execv("/bin/sh", argv); + // Caller will show error on failure to exec } int XSession::type() const { -- cgit v1.2.3-55-g7522