Fix compilation error with generated initializers for repeated pointer fields
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>
Sun, 7 Sep 2014 16:49:00 +0000 (19:49 +0300)
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>
Sun, 7 Sep 2014 16:49:00 +0000 (19:49 +0300)
generator/nanopb_generator.py

index 56dfdb0..9ffed03 100755 (executable)
@@ -596,6 +596,8 @@ class Message:
                 else:
                     parts.append(field.get_initializer(null_init))
             elif field.allocation == 'POINTER':
+                if field.rules == 'REPEATED':
+                    parts.append('0')
                 parts.append('NULL')
             elif field.allocation == 'CALLBACK':
                 if field.pbtype == 'EXTENSION':