From ebd7df6e5794bbfe4e283f1bed9ac18bf6974d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Fri, 2 Jan 2015 18:42:35 +0000 Subject: [PATCH] qdoc: Use qgetenv instead of getenv Fixes warning with MSVC: config.cpp(973) : warning C4996: 'getenv': This function or variable may be unsafe Change-Id: I32d2a521ff82ee9779fbcba76e80ef36a8e02094 Reviewed-by: Martin Smith --- src/tools/qdoc/config.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp index f73ac147b8..450e7b9560 100644 --- a/src/tools/qdoc/config.cpp +++ b/src/tools/qdoc/config.cpp @@ -1006,8 +1006,8 @@ void Config::load(Location location, const QString& fileName) SKIP_CHAR(); } if (!var.isEmpty()) { - char *val = getenv(var.toLatin1().data()); - if (val == 0) { + const QByteArray val = qgetenv(var.toLatin1().data()); + if (val.isNull()) { location.fatal(tr("Environment variable '%1' undefined").arg(var)); } else { @@ -1114,8 +1114,8 @@ void Config::load(Location location, const QString& fileName) SKIP_CHAR(); } if (!var.isEmpty()) { - char *val = getenv(var.toLatin1().data()); - if (val == 0) { + const QByteArray val = qgetenv(var.toLatin1().constData()); + if (val.isNull()) { location.fatal(tr("Environment variable '%1' undefined").arg(var)); } else {