diff --git a/include/rapidjson/reader.h b/include/rapidjson/reader.h index a4cb0af..e6c7471 100644 --- a/include/rapidjson/reader.h +++ b/include/rapidjson/reader.h @@ -1299,11 +1299,11 @@ private: } else { StackStream stackStream(stack_); - SizeType numCharsToCopy = s.Length(); + SizeType numCharsToCopy = s.Length(); while (numCharsToCopy--) { - Transcoder::Transcode(is, stackStream); + Transcoder::Transcode(is, stackStream); } - stackStream.Put('\0'); + stackStream.Put('\0'); const typename TargetEncoding::Ch* str = stackStream.Pop(); const SizeType length = static_cast(stackStream.Length()) - 1; cont = handler.RawNumber(str, SizeType(length), true); diff --git a/test/unittest/readertest.cpp b/test/unittest/readertest.cpp index 221fd2f..8690da6 100644 --- a/test/unittest/readertest.cpp +++ b/test/unittest/readertest.cpp @@ -1170,6 +1170,8 @@ struct IterativeParsingReaderHandler { bool Double(double) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_DOUBLE; return true; } + bool RawNumber(const Ch*, SizeType, bool) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STRING; return true; } + bool String(const Ch*, SizeType, bool) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STRING; return true; } bool StartObject() { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STARTOBJECT; return true; }