From 4ae99048227d7143b9a21bf827ad018da41ce29e Mon Sep 17 00:00:00 2001 From: hg <4683435+hgtw@users.noreply.github.com> Date: Sat, 31 Oct 2020 18:54:49 -0400 Subject: [PATCH] Use strlen for perl hash key size --- zone/embparser_api.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 7a10cc129..17e20b9ec 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -6161,8 +6161,8 @@ XS(XS__get_expedition_lockout_by_char_id) { if (it != lockouts.end()) { - hv_store(hash, "remaining", 9, newSVuv(it->GetSecondsRemaining()), 0); - hv_store(hash, "uuid", 4, newSVpv(it->GetExpeditionUUID().c_str(), 0), 0); + hv_store(hash, "remaining", strlen("remaining"), newSVuv(it->GetSecondsRemaining()), 0); + hv_store(hash, "uuid", strlen("uuid"), newSVpv(it->GetExpeditionUUID().c_str(), 0), 0); } ST(0) = sv_2mortal(newRV((SV*)hash)); // hash refcnt: 2 (-1 mortal), reference: 1 (-1 mortal) @@ -6214,8 +6214,8 @@ XS(XS__get_expedition_lockouts_by_char_id) { if (entry && SvROK(*entry) && SvTYPE(SvRV(*entry)) == SVt_PVHV) // is ref to hash type { HV* details_hash = newHV(); // refcnt +1, reference will take ownership - hv_store(details_hash, "remaining", 9, newSVuv(lockout.GetSecondsRemaining()), 0); - hv_store(details_hash, "uuid", 4, newSVpv(lockout.GetExpeditionUUID().c_str(), 0), 0); + hv_store(details_hash, "remaining", strlen("remaining"), newSVuv(lockout.GetSecondsRemaining()), 0); + hv_store(details_hash, "uuid", strlen("uuid"), newSVpv(lockout.GetExpeditionUUID().c_str(), 0), 0); HV* event_hash = (HV*)SvRV(*entry); hv_store(event_hash, lockout.GetEventName().c_str(), event_len,