smm_variable: remove duplicate string size calc.
std::basic_string can not return the number of bytes needed to store
the string. The size function returns the number of character values,
which for multi byte strings is not the size but the length.
As a solution the code needs to calculate the "real" size, which was
done at multiple places with repeated code. Introduce a template
function called string_get_length_in_bytes() to remove code duplication.
Change-Id: I5d557558f9f9bb14b8905bd3afddee1faef8142a
Signed-off-by: Gyorgy Szing <Gyorgy.Szing@arm.com>
1 file changed