diff options
Diffstat (limited to 'source/fud_directory.cpp')
-rw-r--r-- | source/fud_directory.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/fud_directory.cpp b/source/fud_directory.cpp index 1fcebe1..1697692 100644 --- a/source/fud_directory.cpp +++ b/source/fud_directory.cpp @@ -199,13 +199,16 @@ Result<std::optional<DirectoryEntry>, FudStatus> Directory::getNextEntry() return RetType::error(m_status); } - auto entryName = String{entryNameCString}; - auto retValue = DirectoryEntry::fromStat(entryName, sBuffer); + auto entryNameResult = String::makeFromCString(entryNameCString); + if (entryNameResult.isError()) { + return RetType::error(entryNameResult); + } + auto retValue = DirectoryEntry::fromStat(entryNameResult.getOkay(), sBuffer); if (retValue.isOkay()) { m_errorCode = 0; m_status = FudStatus::Success; - return RetType::okay(std::move(retValue.getOkay())); + return RetType::okay(retValue.takeOkay()); } m_status = retValue.getError(); |