diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2005-07-11 20:46:15 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2005-07-11 20:46:15 +0000 |
| commit | 88bb4a58d30cf36150fd40353b82ba82a83c5127 (patch) | |
| tree | 742d20c83f84ad3fb8b960d739e2b244bd5e3267 | |
| parent | 22986c92c48ed7b9e828e849bb85684269cc6232 (diff) | |
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
| -rw-r--r-- | CHANGES | 1 | ||||
| -rw-r--r-- | test/fonts.cxx | 6 |
2 files changed, 5 insertions, 2 deletions
@@ -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 diff --git a/test/fonts.cxx b/test/fonts.cxx index 1c158915a..d6155495b 100644 --- a/test/fonts.cxx +++ b/test/fonts.cxx @@ -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]; |
