diff --git a/profiles/cclcc/charset.lua b/profiles/cclcc/charset.lua index 05bdb4ec..3d79876f 100644 --- a/profiles/cclcc/charset.lua +++ b/profiles/cclcc/charset.lua @@ -15,7 +15,7 @@ for p, c in utf8.codes(charsetStr) do i = i + 1 end -for i = 0, (64 * 117) - 1 do root.Charset.Flags[i] = 0; end +for i = 0, (64 * 125) - 1 do root.Charset.Flags[i] = 0; end local spaces = {[0]=0, 63}; for i = 0, #spaces do diff --git a/src/profile/charset.cpp b/src/profile/charset.cpp index cfcba52b..c96835dd 100644 --- a/src/profile/charset.cpp +++ b/src/profile/charset.cpp @@ -13,7 +13,7 @@ void Load() { EnsurePushMemberOfType("Flags", LUA_TTABLE); uint32_t flagsCount = (uint32_t)lua_rawlen(LuaState, -1); - Flags = (uint8_t*)malloc(flagsCount + 1); + Flags.resize(flagsCount + 1); PushInitialIndex(); while (PushNextTableElement() != 0) { int i = EnsureGetKeyInt(); diff --git a/src/profile/charset.h b/src/profile/charset.h index 48834e95..127c05e7 100644 --- a/src/profile/charset.h +++ b/src/profile/charset.h @@ -7,7 +7,7 @@ namespace Impacto { namespace Profile { namespace Charset { -inline uint8_t *Flags = nullptr; +inline std::vector Flags; inline ska::flat_hash_map CharacterToSc3; void Load();