mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
Fixed assert in flatc converting to text.
Change-Id: Idac375b22aa9beaba162084cc3396f5536a4e721 Tested: on Linux.
This commit is contained in:
@@ -98,7 +98,7 @@ static void Error(const std::string &err, bool usage, bool show_exe_name) {
|
||||
" also implies --no-prefix.\n"
|
||||
" --gen-includes (deprecated), this is the default behavior.\n"
|
||||
" If the original behavior is required (no include\n"
|
||||
" statements) use --no-includes.\n"
|
||||
" statements) use --no-includes.\n"
|
||||
" --no-includes Don\'t generate include statements for included\n"
|
||||
" schemas the generated file depends on (C++).\n"
|
||||
" --gen-mutable Generate accessors that can mutate buffers in-place.\n"
|
||||
@@ -201,13 +201,13 @@ int main(int argc, const char *argv[]) {
|
||||
++file_it) {
|
||||
std::string contents;
|
||||
if (!flatbuffers::LoadFile(file_it->c_str(), true, &contents))
|
||||
Error("unable to load file" + *file_it);
|
||||
Error("unable to load file: " + *file_it);
|
||||
|
||||
bool is_binary = static_cast<size_t>(file_it - filenames.begin()) >=
|
||||
binary_files_from;
|
||||
if (is_binary) {
|
||||
parser.builder_.Clear();
|
||||
parser.builder_.PushBytes(
|
||||
parser.builder_.PushFlatBuffer(
|
||||
reinterpret_cast<const uint8_t *>(contents.c_str()),
|
||||
contents.length());
|
||||
if (!raw_binary) {
|
||||
|
||||
Reference in New Issue
Block a user