summaryrefslogtreecommitdiff
path: root/source/libfud.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/libfud.cpp')
-rw-r--r--source/libfud.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/source/libfud.cpp b/source/libfud.cpp
index 538d3a9..802b2c7 100644
--- a/source/libfud.cpp
+++ b/source/libfud.cpp
@@ -37,7 +37,7 @@ FUD fud()
return fudInfo;
}
-Result<String, FudStatus> getEnv(const char* name)
+Result<String, FudStatus> getEnv(const char* name, Allocator* allocator)
{
using RetType = Result<String, FudStatus>;
@@ -50,12 +50,7 @@ Result<String, FudStatus> getEnv(const char* name)
return RetType::error(FudStatus::NotFound);
}
- auto envVarResult = String::makeFromCString(resultString);
- if (envVarResult.isError()) {
- return RetType::error(envVarResult);
- }
-
- return RetType::okay(std::move(envVarResult));
+ return String::makeFromCString(resultString, allocator);
}
} // namespace fud