summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r--src/corelib/global/qglobal.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 7913af3103..ac2f72d573 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -3127,11 +3127,14 @@ int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
return 0;
}
#endif
- const qlonglong value = qstrtoll(buffer, Q_NULLPTR, 0, ok);
+ bool ok_ = true;
+ const qlonglong value = qstrtoll(buffer, Q_NULLPTR, 0, &ok_);
if (int(value) != value) { // this is the check in QByteArray::toInt(), keep it in sync
if (ok)
*ok = false;
return 0;
+ } else if (ok) {
+ *ok = ok_;
}
return int(value);
}