]> git.tdb.fi Git - libs/gltk.git/commitdiff
Fix a comparison that let an off-by-one error in
authorMikko Rasa <tdb@tdb.fi>
Sun, 30 Jun 2013 21:01:57 +0000 (00:01 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 30 Jun 2013 21:01:57 +0000 (00:01 +0300)
source/list.cpp

index fbb711e146cab0d1fba0187dd8fdcf743896de60..7227f0c59f6cd971ec330f6de266b84d8ecadc82 100644 (file)
@@ -121,7 +121,7 @@ void List::set_view_all()
 
 void List::set_selected_index(int i)
 {
-       if(i>static_cast<int>(data->size()))
+       if(i>=static_cast<int>(data->size()))
                throw out_of_range("List::set_selected_index");
 
        if(sel_index>=0)