diff --git a/src/reflection.cpp b/src/reflection.cpp index ab39e1e20..d82c046cc 100644 --- a/src/reflection.cpp +++ b/src/reflection.cpp @@ -289,7 +289,7 @@ void SetString(const reflection::Schema &schema, const std::string &val, auto delta = static_cast(val.size()) - static_cast(str->Length()); auto str_start = static_cast( reinterpret_cast(str) - flatbuf->data()); - auto start = str_start + sizeof(uoffset_t); + auto start = str_start + static_cast(sizeof(uoffset_t)); if (delta) { // Clear the old string, since we don't want parts of it remaining. memset(flatbuf->data() + start, 0, str->Length());