summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-05-29 12:29:55 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-05-29 14:47:58 +0000
commitaff3f7f767617c9f569ed5101a12d677233be901 (patch)
treefa14c00989eba3308b7ea6c7e65b320f616b4098 /src/corelib/global/qglobal.cpp
parentc0ddd5fa12f696838cb1d1de3f721f19a87c8509 (diff)
Fix QIODevice::errorString() and other places where we expose errno
Commit e486d69133178ccce7c75cf48201ab28efb20e44 changed the behavior of QString::fromLocal8Bit(const QByteArray &) to preserve embedded null characters. The embedded null character from qt_error_string()'s buffer is not something we want to preserve, it is merely a safe guard. Therefore let's strip it away. Change-Id: Iceac91551f51a1036a942ff30d246baea7a6fd7c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r--src/corelib/global/qglobal.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 2176a148b0..4f611bddbc 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2955,7 +2955,7 @@ namespace {
// depending on the return type
static inline Q_DECL_UNUSED QString fromstrerror_helper(int, const QByteArray &buf)
{
- return QString::fromLocal8Bit(buf);
+ return QString::fromLocal8Bit(buf.constData());
}
static inline Q_DECL_UNUSED QString fromstrerror_helper(const char *str, const QByteArray &)
{