Codechange: let ReadLine return a string instead of passing a buffer

This commit is contained in:
Rubidium
2023-06-09 18:10:24 +02:00
committed by rubidium42
parent 81f957b9f8
commit 6d597879d0
4 changed files with 17 additions and 21 deletions

View File

@@ -102,14 +102,10 @@ struct StringListReader : StringReader {
{
}
char *ReadLine(char *buffer, const char *last) override
std::optional<std::string> ReadLine() override
{
if (this->p == this->end) return nullptr;
strecpy(buffer, this->p->c_str(), last);
this->p++;
return buffer;
if (this->p == this->end) return std::nullopt;
return *this->p++;
}
};