2003-08-05 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / reggroups.c
index 791ec0abd521f426295bcbd83bb1509736b519db..70009577818e636fa99db76554d7a3bfe02a0304 100644 (file)
@@ -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;
 }
This page took 0.023672 seconds and 4 git commands to generate.