mirror of
https://github.com/alterware/iw4-validator.git
synced 2025-11-29 14:17:48 +00:00
fix VA
This commit is contained in:
@@ -28,16 +28,16 @@ namespace utils::string
|
||||
|
||||
while (true)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
const auto res = vsnprintf_s(entry->buffer_, entry->size_, _TRUNCATE, format, ap);
|
||||
#else
|
||||
const auto res = vsnprintf(entry->buffer_, entry->size_, format, ap);
|
||||
#endif
|
||||
if (res < 0) return nullptr; // Error
|
||||
|
||||
if (res > 0) break; // Success
|
||||
if (res == 0) return nullptr; // Error
|
||||
if (static_cast<std::size_t>(res) >= entry->size_)
|
||||
{
|
||||
entry->double_size();
|
||||
continue;
|
||||
}
|
||||
|
||||
entry->double_size();
|
||||
break; // >= 0 Success
|
||||
}
|
||||
|
||||
return entry->buffer_;
|
||||
|
||||
Reference in New Issue
Block a user