aboutsummaryrefslogtreecommitdiff
path: root/gdb/reggroups.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-08-05 18:08:59 +0000
committerAndrew Cagney <cagney@redhat.com>2003-08-05 18:08:59 +0000
commit9dd5f34f8d4ac79c8e55bb1e5690053cd69e5f51 (patch)
treed0bc2480890e37cd176cdbc782f72f98009335ed /gdb/reggroups.c
parent50d6c87817d9b450dcad0ab0ef0a1c5d3a1c149c (diff)
2003-08-05 Andrew Cagney <cagney@redhat.com>
* reggroups.c (reggroup_next): Check for the final entry.
Diffstat (limited to 'gdb/reggroups.c')
-rw-r--r--gdb/reggroups.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/reggroups.c b/gdb/reggroups.c
index 791ec0abd5..7000957781 100644
--- a/gdb/reggroups.c
+++ b/gdb/reggroups.c
@@ -132,13 +132,18 @@ reggroup_next (struct gdbarch *gdbarch, struct reggroup *last)
if (groups->first == NULL)
groups = &default_groups;
- /* Retun the first/next reggroup. */
+ /* Return the first/next reggroup. */
if (last == NULL)
return groups->first->group;
for (el = groups->first; el != NULL; el = el->next)
{
if (el->group == last)
- return el->next->group;
+ {
+ if (el->next != NULL)
+ return el->next->group;
+ else
+ return NULL;
+ }
}
return NULL;
}