diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ebrowse.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index c59181f9464..7a262005df9 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c | |||
| @@ -32,6 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 32 | #define SEEK_END 2 | 32 | #define SEEK_END 2 |
| 33 | #endif | 33 | #endif |
| 34 | 34 | ||
| 35 | #include <flexmember.h> | ||
| 35 | #include <min-max.h> | 36 | #include <min-max.h> |
| 36 | 37 | ||
| 37 | /* Files are read in chunks of this number of bytes. */ | 38 | /* Files are read in chunks of this number of bytes. */ |
| @@ -582,7 +583,7 @@ add_sym (const char *name, struct sym *nested_in_class) | |||
| 582 | puts (name); | 583 | puts (name); |
| 583 | } | 584 | } |
| 584 | 585 | ||
| 585 | sym = xmalloc (offsetof (struct sym, name) + strlen (name) + 1); | 586 | sym = xmalloc (FLEXSIZEOF (struct sym, name, strlen (name) + 1)); |
| 586 | memset (sym, 0, offsetof (struct sym, name)); | 587 | memset (sym, 0, offsetof (struct sym, name)); |
| 587 | strcpy (sym->name, name); | 588 | strcpy (sym->name, name); |
| 588 | sym->namesp = scope; | 589 | sym->namesp = scope; |
| @@ -867,8 +868,8 @@ add_global_decl (char *name, char *regexp, int pos, unsigned int hash, int var, | |||
| 867 | static struct member * | 868 | static struct member * |
| 868 | add_member (struct sym *cls, char *name, int var, int sc, unsigned int hash) | 869 | add_member (struct sym *cls, char *name, int var, int sc, unsigned int hash) |
| 869 | { | 870 | { |
| 870 | struct member *m = xmalloc (offsetof (struct member, name) | 871 | struct member *m = xmalloc (FLEXSIZEOF (struct member, name, |
| 871 | + strlen (name) + 1); | 872 | strlen (name) + 1)); |
| 872 | struct member **list; | 873 | struct member **list; |
| 873 | struct member *p; | 874 | struct member *p; |
| 874 | struct member *prev; | 875 | struct member *prev; |
| @@ -978,7 +979,7 @@ mark_inherited_virtual (void) | |||
| 978 | static struct sym * | 979 | static struct sym * |
| 979 | make_namespace (char *name, struct sym *context) | 980 | make_namespace (char *name, struct sym *context) |
| 980 | { | 981 | { |
| 981 | struct sym *s = xmalloc (offsetof (struct sym, name) + strlen (name) + 1); | 982 | struct sym *s = xmalloc (FLEXSIZEOF (struct sym, name, strlen (name) + 1)); |
| 982 | memset (s, 0, offsetof (struct sym, name)); | 983 | memset (s, 0, offsetof (struct sym, name)); |
| 983 | strcpy (s->name, name); | 984 | strcpy (s->name, name); |
| 984 | s->next = all_namespaces; | 985 | s->next = all_namespaces; |
| @@ -1062,7 +1063,7 @@ register_namespace_alias (char *new_name, struct link *old_name) | |||
| 1062 | if (streq (new_name, al->name) && (al->namesp == current_namespace)) | 1063 | if (streq (new_name, al->name) && (al->namesp == current_namespace)) |
| 1063 | return; | 1064 | return; |
| 1064 | 1065 | ||
| 1065 | al = xmalloc (offsetof (struct alias, name) + strlen (new_name) + 1); | 1066 | al = xmalloc (FLEXSIZEOF (struct alias, name, strlen (new_name) + 1)); |
| 1066 | strcpy (al->name, new_name); | 1067 | strcpy (al->name, new_name); |
| 1067 | al->next = namespace_alias_table[h]; | 1068 | al->next = namespace_alias_table[h]; |
| 1068 | al->namesp = current_namespace; | 1069 | al->namesp = current_namespace; |