summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2014-01-03 16:17:05 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2014-01-03 16:17:05 +0000
commit642c475493a6f881a12953f984aab03e43f5aa55 (patch)
tree33b9df3362d5c07998c33f5fb4e34b888ca0b75c /src
parent1af599b4af6ebadde6ec0b87c30cfc9a2259f797 (diff)
Fixed segfault in fl_set_fonts_xft.cxx when loading fonts not named
as expected (STR #2976). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10041 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/fl_set_fonts_xft.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fl_set_fonts_xft.cxx b/src/fl_set_fonts_xft.cxx
index 2aa3edcaf..13374ee7f 100644
--- a/src/fl_set_fonts_xft.cxx
+++ b/src/fl_set_fonts_xft.cxx
@@ -82,7 +82,6 @@ static void make_raw_name(char *raw, char *pretty)
// italic, bold, bold italic or normal - this seems to be the fltk way...
char *style = strchr(pretty, ':');
- char *last = style + strlen(style) - 2;
if (style)
{
@@ -120,7 +119,10 @@ static void make_raw_name(char *raw, char *pretty)
#define BOLD 1
#define ITALIC 2
#define BITALIC (BOLD | ITALIC)
+
int mods = PLAIN;
+ char *last = style + strlen(style) - 2;
+
// Now try and parse the style string - look for the "=" sign
style = strchr(style, '=');
while ((style) && (style < last))