From f31cb3555b0105628b4fb8ef04e618c173f1d60b Mon Sep 17 00:00:00 2001 From: Vibhav Pant Date: Wed, 29 Nov 2023 14:24:30 +0530 Subject: [PATCH] Use the correct type for storing getenv's return value. --- tests/common/Instruments.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/common/Instruments.h b/tests/common/Instruments.h index 3eddbd7f..befb2398 100644 --- a/tests/common/Instruments.h +++ b/tests/common/Instruments.h @@ -310,7 +310,7 @@ public: TestInstrumentsEnvVarGuard(std::string variable, const std::string &value) : mVar(std::move(variable)), mHasInitValue(false), mInitValue() { - char *initValue = getenv(mVar.c_str()); + const char *initValue = getenv(mVar.c_str()); if (initValue != nullptr) { mHasInitValue = true; @@ -349,7 +349,7 @@ protected: explicit TestInstrumentsEnvVarGuard(std::string variable) : mVar(std::move(variable)), mHasInitValue(false), mInitValue() { - char *initValue = getenv(mVar.c_str()); + const char *initValue = getenv(mVar.c_str()); if (initValue != nullptr) { mHasInitValue = true;