summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-10-16 23:02:49 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-10-16 23:02:49 +0000
commit65c019830b84f67b370bc665ee65b7e846ea027b (patch)
tree38f7a5cd52ca8c5ef2d3a3b16e1eef5cf5d95809
parent7db8fe569d8598355299e1fbfc0ed6b49924a075 (diff)
Make sure that font names are zeroed.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2677 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES2
-rw-r--r--src/fl_set_font.cxx13
2 files changed, 12 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 056a2e930..6d647c67f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.1
+ - Fl::set_font() didn't 0-initialize all font descriptor
+ data.
- Some OpenGL implementations don't support single-
buffered visuals. The Fl_Gl_Window class now emulates
single-buffered windows using double-buffered
diff --git a/src/fl_set_font.cxx b/src/fl_set_font.cxx
index d3c10a51c..4b78278c1 100644
--- a/src/fl_set_font.cxx
+++ b/src/fl_set_font.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_set_font.cxx,v 1.5.2.3.2.7 2002/07/01 20:14:08 easysw Exp $"
+// "$Id: fl_set_font.cxx,v 1.5.2.3.2.8 2002/10/16 23:02:49 easysw Exp $"
//
// Font utilities for the Fast Light Tool Kit (FLTK).
//
@@ -47,7 +47,14 @@ void Fl::set_font(Fl_Font fnum, const char* name) {
table_size = 2*table_size;
fl_fonts=(Fl_Fontdesc*)realloc(fl_fonts, table_size*sizeof(Fl_Fontdesc));
}
- for (; i < table_size; i++) fl_fonts[i].name = 0;
+ for (; i < table_size; i++) {
+ fl_fonts[i].fontname[0] = 0;
+ fl_fonts[i].name = 0;
+#if !defined(WIN32) && !defined(__APPLE__)
+ fl_fonts[i].xlist = 0;
+ fl_fonts[i].n = 0;
+#endif // !WIN32 && !__APPLE__
+ }
}
Fl_Fontdesc* s = fl_fonts+fnum;
if (s->name) {
@@ -74,5 +81,5 @@ void Fl::set_font(Fl_Font fnum, Fl_Font from) {
const char* Fl::get_font(Fl_Font fnum) {return fl_fonts[fnum].name;}
//
-// End of "$Id: fl_set_font.cxx,v 1.5.2.3.2.7 2002/07/01 20:14:08 easysw Exp $".
+// End of "$Id: fl_set_font.cxx,v 1.5.2.3.2.8 2002/10/16 23:02:49 easysw Exp $".
//