mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-29 21:52:01 +00:00
[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:
committed by
Wouter van Oortmerssen
parent
81ecc98e02
commit
6a7ec85e83
@@ -154,6 +154,9 @@ class FlatBufPrinter : public grpc_generator::Printer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Print(const char *s) {
|
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.
|
// Add this string, but for each part separated by \n, add indentation.
|
||||||
for (;;) {
|
for (;;) {
|
||||||
// Current indentation.
|
// Current indentation.
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user