aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-osf.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/solib-osf.c')
-rw-r--r--gdb/solib-osf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/solib-osf.c b/gdb/solib-osf.c
index 9fd52f8..dec737b 100644
--- a/gdb/solib-osf.c
+++ b/gdb/solib-osf.c
@@ -424,8 +424,8 @@ init_so (struct so_list *so, char *name, int isloader, int nsecs)
memcpy (so->so_name, so->so_original_name, namelen + 1);
/* Allocate section space. */
- so->lm_info = xmalloc ((unsigned) &(((struct lm_info *)0)->secs) +
- nsecs * sizeof *so->lm_info);
+ so->lm_info = xmalloc (sizeof (struct lm_info)
+ + (nsecs - 1) * sizeof (struct lm_sec));
so->lm_info->isloader = isloader;
so->lm_info->nsecs = nsecs;
for (i = 0; i < nsecs; i++)