* gdbtypes.c (init_flags_type): Set all fields to zero instead of
authorMark Kettenis <kettenis@gnu.org>
Tue, 22 Aug 2006 19:45:12 +0000 (19:45 +0000)
committerMark Kettenis <kettenis@gnu.org>
Tue, 22 Aug 2006 19:45:12 +0000 (19:45 +0000)
just the first one.

gdb/ChangeLog
gdb/gdbtypes.c

index 1328dee12c2df587eee06116b248da8337d86a7a..618a1dec10d02c3b9ce1a45b6f8325943ff1bd49 100644 (file)
@@ -1,3 +1,8 @@
+2006-08-22  Mark Kettenis  <kettenis@gnu.org>
+
+       * gdbtypes.c (init_flags_type): Set all fields to zero instead of
+       just the first one.
+
 2006-08-22  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * Makefile.in (INTERNAL_CPPFLAGS): New.
index 0d297281a1358a91e0e78e23a1ccc466cf517c92..4c9f047d626b1b3486bdd2da4f54528223168494 100644 (file)
@@ -878,7 +878,7 @@ init_flags_type (char *name, int length)
   type = init_type (TYPE_CODE_FLAGS, length, TYPE_FLAG_UNSIGNED, name, NULL);
   TYPE_NFIELDS (type) = nfields;
   TYPE_FIELDS (type) = TYPE_ALLOC (type, nfields * sizeof (struct field));
-  memset (TYPE_FIELDS (type), 0, sizeof (struct field));
+  memset (TYPE_FIELDS (type), 0, nfields * sizeof (struct field));
 
   return type;
 }