summaryrefslogtreecommitdiff
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
commit567363e5cb4b47099741cf23bee5fd5b647e4bd6 (patch)
tree18257e68aa51b40117110ad75e91f0ecc2f38c95 /gdb/reggroups.c
parent5736a49d2ad6e99c0ad4c2b5e0f8b324519e0682 (diff)
downloadgdb-567363e5cb4b47099741cf23bee5fd5b647e4bd6.tar.gz
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 791ec0abd52..70009577818 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;
}