From 88bb4a58d30cf36150fd40353b82ba82a83c5127 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 11 Jul 2005 20:46:15 +0000 Subject: [PATCH] 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 --- CHANGES | 1 + test/fonts.cxx | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 2a87834a4..a3d797c5d 100644 --- a/CHANGES +++ b/CHANGES @@ -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];