From 65c3b110e48a73b4bc6fe2cb1f37d2415c0aa3d2 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 27 Mar 2020 09:16:06 +1100 Subject: Backport: Avoid casts by returning size_t from GetExpanded. Backport of changeset 8099:2228fb724ce7. --- lexlib/PropSetSimple.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lexlib/PropSetSimple.cxx') diff --git a/lexlib/PropSetSimple.cxx b/lexlib/PropSetSimple.cxx index 5ce353c71..6e1312527 100644 --- a/lexlib/PropSetSimple.cxx +++ b/lexlib/PropSetSimple.cxx @@ -137,10 +137,10 @@ static int ExpandAllInPlace(const PropSetSimple &props, std::string &withVars, i return maxExpands; } -int PropSetSimple::GetExpanded(const char *key, char *result) const { +size_t PropSetSimple::GetExpanded(const char *key, char *result) const { std::string val = Get(key); ExpandAllInPlace(*this, val, 100, VarChain(key)); - const int n = static_cast(val.size()); + const size_t n = val.size(); if (result) { memcpy(result, val.c_str(), n+1); } -- cgit v1.2.3