From 88bb4a58d30cf36150fd40353b82ba82a83c5127 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 11 Jul 2005 20:46:15 +0000 Subject: 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 --- test/fonts.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test') 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]; -- cgit v1.2.3