Fix out-of-range error (MSVC2010) in idl_gen_dart.cpp (#5335)

-- MSVC2010 doesn't support indexed access to \0-terminator.
This commit is contained in:
Vladimir Glavnyy
2019-05-10 00:05:21 +07:00
committed by Wouter van Oortmerssen
parent 103f61b685
commit b701c7d56e

View File

@@ -120,7 +120,7 @@ class DartGenerator : public BaseGenerator {
std::ostream_iterator<std::string>(sstream, "."));
auto ret = sstream.str() + ns.components.back();
for (int i = 0; ret[i]; i++) {
for (size_t i = 0; i < ret.size(); i++) {
auto lower = tolower(ret[i]);
if (lower != ret[i]) {
ret[i] = static_cast<char>(lower);