[C++] Fix code gen indentation when empty Print (#4313)

* Fix C++ code gen indentation when empty Print

* Also commit modified tests/monster_test.bfbs
This commit is contained in:
Lawrence Chan
2017-05-12 16:36:35 -05:00
committed by Wouter van Oortmerssen
parent 81ecc98e02
commit 6a7ec85e83
3 changed files with 9 additions and 6 deletions

View File

@@ -154,6 +154,9 @@ class FlatBufPrinter : public grpc_generator::Printer {
}
void Print(const char *s) {
if (s == nullptr || std::strlen(s) == 0) {
return;
}
// Add this string, but for each part separated by \n, add indentation.
for (;;) {
// Current indentation.