Skip to content

Commit

Permalink
Range check input to Fl_Choice::value(n).
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2497 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Jul 9, 2002
1 parent 81d431c commit 0cca486
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES
@@ -1,5 +1,6 @@
CHANGES IN FLTK 1.1.0

- Fl_Choice::value(n) didn't range check "n".
- The MingW and OS/2 makeinclude files didn't have the
new fltk_images library definitions.
- Fl_Text_Editor didn't scroll the text in the widget
Expand Down
5 changes: 3 additions & 2 deletions src/Fl_Choice.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Choice.cxx,v 1.10.2.5.2.9 2002/04/11 10:46:19 easysw Exp $"
// "$Id: Fl_Choice.cxx,v 1.10.2.5.2.10 2002/07/09 17:18:45 easysw Exp $"
//
// Choice widget for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -85,6 +85,7 @@ Fl_Choice::Fl_Choice(int x,int y,int w,int h, const char *l)
}

int Fl_Choice::value(int v) {
if (v < 0 || v >= (size() - 1)) return 0;
if (!Fl_Menu_::value(v)) return 0;
redraw();
return 1;
Expand Down Expand Up @@ -128,5 +129,5 @@ int Fl_Choice::handle(int e) {
}

//
// End of "$Id: Fl_Choice.cxx,v 1.10.2.5.2.9 2002/04/11 10:46:19 easysw Exp $".
// End of "$Id: Fl_Choice.cxx,v 1.10.2.5.2.10 2002/07/09 17:18:45 easysw Exp $".
//

0 comments on commit 0cca486

Please sign in to comment.