From 1d51fa691fab1bf0462de64a7dcdcc39981da7ef Mon Sep 17 00:00:00 2001 From: Albert Hung Date: Mon, 20 May 2024 09:02:45 +0800 Subject: [PATCH] Initialize _pool array in tinyxml2.h Added {} to the declaration of the _pool array in the tinyxml2.h file. This ensures that all elements of the _pool array are initialized to their default values. This change improves the safety and predictability of the code by preventing uninitialized values. --- tinyxml2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinyxml2.h b/tinyxml2.h index 7586f7b8..a3b3e6dd 100755 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -314,7 +314,7 @@ class DynArray } T* _mem; - T _pool[static_cast(INITIAL_SIZE)]; + T _pool[static_cast(INITIAL_SIZE)] = {}; int _allocated; // objects allocated int _size; // number objects in use };