Fixed static allocation of 1000 font information units in fonts.cxx.

Although this fixes the crash, the font enumerator in FLTK should never return a number larger than 255 (which unfortunatly is the maximum number of fonts supported by FLTK 1 for binary compatibility)

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4411 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2005-07-11 20:46:15 +00:00
parent 22986c92c4
commit 88bb4a58d3
2 changed files with 5 additions and 2 deletions

View File

@ -3,6 +3,7 @@ CHANGES IN FLTK 1.1.7
- Documentation fixes (STR #648, STR #692, STR #730, STR
#744, STR #745)
- Fixed hang on corrupt jpeg (STR #915)
- Fixed static allocation of font buffer in demo (STR #909)
- Added symbols 'refresh', 'reload', 'undo', and 'redo'.
- Fixed focus loss on Fl_Window:resize()
- Fl::delete_widget would hang fl_wait after deleting the

View File

@ -54,8 +54,8 @@ FontDisplay *textobj;
Fl_Hold_Browser *fontobj, *sizeobj;
int *sizes[1000];
int numsizes[1000];
int **sizes;
int *numsizes;
int pickedsize = 14;
void font_cb(Fl_Widget *, long) {
@ -141,6 +141,8 @@ int main(int argc, char **argv) {
int i = fl_choice("Which fonts:","-*","iso8859","All");
#endif
int k = Fl::set_fonts(i ? (i>1 ? "*" : 0) : "-*");
sizes = new int*[k];
numsizes = new int[k];
for (i = 0; i < k; i++) {
int t; const char *name = Fl::get_font_name((Fl_Font)i,&t);
char buffer[128];