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 <martin.smith@digia.com>
This commit is contained in:
Sérgio Martins 2015-01-02 18:42:35 +00:00
parent f38b7e0343
commit ebd7df6e57

View File

@ -1006,8 +1006,8 @@ void Config::load(Location location, const QString& fileName)
SKIP_CHAR(); SKIP_CHAR();
} }
if (!var.isEmpty()) { if (!var.isEmpty()) {
char *val = getenv(var.toLatin1().data()); const QByteArray val = qgetenv(var.toLatin1().data());
if (val == 0) { if (val.isNull()) {
location.fatal(tr("Environment variable '%1' undefined").arg(var)); location.fatal(tr("Environment variable '%1' undefined").arg(var));
} }
else { else {
@ -1114,8 +1114,8 @@ void Config::load(Location location, const QString& fileName)
SKIP_CHAR(); SKIP_CHAR();
} }
if (!var.isEmpty()) { if (!var.isEmpty()) {
char *val = getenv(var.toLatin1().data()); const QByteArray val = qgetenv(var.toLatin1().constData());
if (val == 0) { if (val.isNull()) {
location.fatal(tr("Environment variable '%1' undefined").arg(var)); location.fatal(tr("Environment variable '%1' undefined").arg(var));
} }
else { else {