off-by-one fix for py-linetable.c
[deliverable/binutils-gdb.git] / gdb / python / py-linetable.c
index 8c01a0ee141d73ebb47098f36cc814bb90a72e45..e0449a674c625973d834066430816e5d7554611f 100644 (file)
@@ -215,7 +215,7 @@ ltpy_has_line (PyObject *self, PyObject *args)
       return NULL;
     }
 
-  for (index = 0; index <= LINETABLE (symtab)->nitems; index++)
+  for (index = 0; index < LINETABLE (symtab)->nitems; index++)
     {
       struct linetable_entry *item = &(symtab->linetable->item[index]);
       if (item->line == py_line)
@@ -252,7 +252,7 @@ ltpy_get_all_source_lines (PyObject *self, PyObject *args)
   if (source_dict == NULL)
     return NULL;
 
-  for (index = 0; index <= LINETABLE (symtab)->nitems; index++)
+  for (index = 0; index < LINETABLE (symtab)->nitems; index++)
     {
       item = &(LINETABLE (symtab)->item[index]);
 
This page took 0.024085 seconds and 4 git commands to generate.