OSDN Git Service

use correct type for buffer in QProcessPrivate::processStarted()
authorIvailo Monev <xakepa10@gmail.com>
Tue, 28 Sep 2021 21:32:53 +0000 (00:32 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Tue, 28 Sep 2021 21:32:53 +0000 (00:32 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/io/qprocess_unix.cpp

index 6cf58c7..b392667 100644 (file)
@@ -659,8 +659,8 @@ void QProcessPrivate::execChild(const char *workingDir, char **path, char **argv
 
 bool QProcessPrivate::processStarted()
 {
-    QSTACKARRAY(ushort, buf, errorBufferMax);
-    qint64 i = qt_safe_read(childStartedPipe[0], &buf, sizeof buf);
+    QSTACKARRAY(QChar, buf, errorBufferMax);
+    qint64 i = qt_safe_read(childStartedPipe[0], &buf, sizeof(buf));
     if (startupSocketNotifier) {
         startupSocketNotifier->setEnabled(false);
         startupSocketNotifier->deleteLater();
@@ -675,7 +675,7 @@ bool QProcessPrivate::processStarted()
 
     // did we read an error message?
     if (i > 0)
-        q_func()->setErrorString(QString((const QChar *)buf, i / sizeof(QChar)));
+        q_func()->setErrorString(QString(buf, i / sizeof(QChar)));
 
     return i <= 0;
 }