Skip to content

Commit

Permalink
Initialize _pool array in tinyxml2.h
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AlbertHungGarmin committed May 20, 2024
1 parent 312a809 commit 1d51fa6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tinyxml2.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class DynArray
}

T* _mem;
T _pool[static_cast<size_t>(INITIAL_SIZE)];
T _pool[static_cast<size_t>(INITIAL_SIZE)] = {};
int _allocated; // objects allocated
int _size; // number objects in use
};
Expand Down

0 comments on commit 1d51fa6

Please sign in to comment.