Fix bug in backwards_compatibility test case.
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>
Fri, 26 Dec 2014 21:03:04 +0000 (23:03 +0200)
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>
Fri, 26 Dec 2014 21:27:34 +0000 (23:27 +0200)
The memset() filled also the extensions field, which was just
waiting for a crash to happen.

tests/backwards_compatibility/decode_legacy.c

index 9dfe437..5f5b6bb 100644 (file)
    the decoding and checks the fields. */
 bool check_alltypes(pb_istream_t *stream, int mode)
 {
-    AllTypes alltypes;
-    
-    /* Fill with garbage to better detect initialization errors */
-    memset(&alltypes, 0xAA, sizeof(alltypes));
+    AllTypes alltypes = {0};
     
     if (!pb_decode(stream, AllTypes_fields, &alltypes))
         return false;