This commit is contained in:
2025-11-28 23:24:58 +01:00
parent c487e446c0
commit e123218787
2 changed files with 8 additions and 8 deletions

View File

@@ -21,7 +21,7 @@ env:
jobs: jobs:
build-windows: build-windows:
name: Build Windows name: Build Windows
runs-on: windows-2022 runs-on: windows-2025
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:

View File

@@ -28,16 +28,16 @@ namespace utils::string
while (true) 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); 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(); entry->double_size();
continue;
}
break; // >= 0 Success
} }
return entry->buffer_; return entry->buffer_;