summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/utils.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/utils.h b/src/gallium/drivers/swr/rasterizer/core/utils.h
index b096d2120cb..c926f6ad7f2 100644
--- a/src/gallium/drivers/swr/rasterizer/core/utils.h
+++ b/src/gallium/drivers/swr/rasterizer/core/utils.h
@@ -365,7 +365,8 @@ static INLINE std::string GetEnv(const std::string& variableName)
output.resize(valueSize - 1); // valueSize includes null, output.resize() does not
GetEnvironmentVariableA(variableName.c_str(), &output[0], valueSize);
#else
- output = getenv(variableName.c_str());
+ char *env = getenv(variableName.c_str());
+ output = env ? env : "";
#endif
return output;