mirror of
https://github.com/alterware/master-server.git
synced 2025-11-30 22:57:49 +00:00
fix: correct usage of C func
This commit is contained in:
@@ -30,11 +30,15 @@ namespace utils::string
|
|||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
const auto res = vsnprintf(entry->buffer_, entry->size_, format, ap);
|
const auto res = vsnprintf(entry->buffer_, entry->size_, format, ap);
|
||||||
|
if (res < 0) return nullptr; // Error
|
||||||
|
|
||||||
if (res > 0) break; // Success
|
if (static_cast<std::size_t>(res) >= entry->size_)
|
||||||
if (res == 0) return nullptr; // Error
|
{
|
||||||
|
|
||||||
entry->double_size();
|
entry->double_size();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
break; // Success
|
||||||
}
|
}
|
||||||
|
|
||||||
return entry->buffer_;
|
return entry->buffer_;
|
||||||
|
|||||||
Reference in New Issue
Block a user