Do not use union to access FIXED_STRING<4> as int

https://en.cppreference.com/w/cpp/language/union:
> It's undefined behavior to read from the member of the union that wasn't most recently written.
This commit is contained in:
elsid 2021-10-17 02:52:22 +02:00
parent 62dfbb33d9
commit 18d3102148
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
51 changed files with 89 additions and 79 deletions

View file

@ -18,7 +18,7 @@ namespace ESM
while (esm.hasMoreSubs())
{
esm.getSubName();
switch (esm.retSubName().intval)
switch (esm.retSubName().toInt())
{
case ESM::SREC_NAME:
mId = esm.getHString();