fl_font(0, 0) as a first call in Xft would try to access a member in fl_fontsize, which was still set to NULL. This fix is untersted as I don't have a Unix machine here. Please verify this fix!

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5035 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2006-04-27 13:54:08 +00:00
parent 8ffe967089
commit cbbec03b5e
2 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.8 CHANGES IN FLTK 1.1.8
- Calling fl_font(0, 0) under Xft would access a NULL
pointer (STR #1205)
- Setting a new value in Fl_Input_ wil now actually move - Setting a new value in Fl_Input_ wil now actually move
cursor to the end of the input field as documented cursor to the end of the input field as documented
(STR #1161) (STR #1161)

View File

@ -95,8 +95,9 @@ const char* fl_encoding_ = "iso8859-1";
Fl_FontSize* fl_fontsize = 0; Fl_FontSize* fl_fontsize = 0;
void fl_font(int fnum, int size) { void fl_font(int fnum, int size) {
if (fnum == fl_font_ && size == fl_size_ && if (fnum == fl_font_ && size == fl_size_
!strcasecmp(fl_fontsize->encoding, fl_encoding_)) && fl_fontsize
&& !strcasecmp(fl_fontsize->encoding, fl_encoding_))
return; return;
fl_font_ = fnum; fl_size_ = size; fl_font_ = fnum; fl_size_ = size;
Fl_Fontdesc *font = fl_fonts + fnum; Fl_Fontdesc *font = fl_fonts + fnum;