summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-04-19 12:26:23 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-04-22 07:42:46 (GMT)
commit56891588a23adfe4ac6a8fbe01083464dc67e79b (patch)
tree7f72293fcdf42161724177bd7f841e86b771d563
parent9da275a24ae0b40ae29292a050c48915ac61099b (diff)
downloadQt-56891588a23adfe4ac6a8fbe01083464dc67e79b.zip
Qt-56891588a23adfe4ac6a8fbe01083464dc67e79b.tar.gz
Qt-56891588a23adfe4ac6a8fbe01083464dc67e79b.tar.bz2
Fix strerror_r in case it returns a pointer that is not our buffer
Task-number: QTBUG-10014 Reviewed-by: Trust Me
-rw-r--r--src/corelib/global/qglobal.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index dfa2c17..e29ad79 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2126,8 +2126,7 @@ QString qt_error_string(int errorCode)
#elif !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && _POSIX_VERSION >= 200112L && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_QNX)
QByteArray buf(1024, '\0');
- strerror_r(errorCode, buf.data(), buf.size());
- ret = QString::fromLocal8Bit(buf.constData());
+ ret = QString::fromLocal8Bit(strerror_r(errorCode, buf.data(), buf.size()));
#else
ret = QString::fromLocal8Bit(strerror(errorCode));
#endif