From c75fb0076a35d30e4ad3e2a8c270dcb5d555db56 Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 7 Feb 2026 08:47:57 +0100 Subject: fix(asset_packer): Replace deprecated sprintf with snprintf Fixes deprecation warning: asset_packer.cc:394:18: warning: 'sprintf' is deprecated Changed std::sprintf to std::snprintf with buffer size check for safer string formatting when generating vertex map keys during OBJ mesh processing. Before: std::sprintf(key_buf, "%d/%d/%d", ...) After: std::snprintf(key_buf, sizeof(key_buf), "%d/%d/%d", ...) This prevents potential buffer overflows and eliminates the compiler warning while maintaining identical functionality. Co-Authored-By: Claude Sonnet 4.5 --- tools/asset_packer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/asset_packer.cc b/tools/asset_packer.cc index 79a6ce6..32742bd 100644 --- a/tools/asset_packer.cc +++ b/tools/asset_packer.cc @@ -391,7 +391,7 @@ int main(int argc, char* argv[]) { for (int i = 0; i < 3; ++i) { // Reconstruct key string for uniqueness check char key_buf[128]; - std::sprintf(key_buf, "%d/%d/%d", face.v[i], face.vt[i], face.vn[i]); + std::snprintf(key_buf, sizeof(key_buf), "%d/%d/%d", face.v[i], face.vt[i], face.vn[i]); std::string key = key_buf; if (vertex_map.find(key) == vertex_map.end()) { -- cgit v1.2.3