diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-08-05 18:08:59 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-08-05 18:08:59 +0000 |
commit | 9dd5f34f8d4ac79c8e55bb1e5690053cd69e5f51 (patch) | |
tree | d0bc2480890e37cd176cdbc782f72f98009335ed /gdb/reggroups.c | |
parent | 50d6c87817d9b450dcad0ab0ef0a1c5d3a1c149c (diff) | |
download | gdb-9dd5f34f8d4ac79c8e55bb1e5690053cd69e5f51.zip gdb-9dd5f34f8d4ac79c8e55bb1e5690053cd69e5f51.tar.gz gdb-9dd5f34f8d4ac79c8e55bb1e5690053cd69e5f51.tar.bz2 |
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.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/reggroups.c b/gdb/reggroups.c index 791ec0a..7000957 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; } |