summaryrefslogtreecommitdiff
path: root/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2020-07-21 20:15:41 -0700
committerGreg Ercolano <erco@seriss.com>2020-08-01 14:19:40 -0700
commit2141c63628a831d3f53dad7035c94028f8d0d629 (patch)
tree614cb7b627da2decbb7cfe49c081f9d7b4140c58 /src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx
parent7514a73ba759f7fc9965eeef3b92ece899bd7a69 (diff)
Implement + deploy fl_strdup()
Diffstat (limited to 'src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx')
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx
index 1e2b492f3..3371c4e08 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx
@@ -41,6 +41,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <FL/fl_string.h>
// This function fills in the FLTK font table with all the fonts that
// are found on the X server. It tries to place the fonts into families
@@ -98,12 +99,12 @@ enumcbw(CONST LOGFONTW *lpelf,
if (!strcmp(Fl::get_font_name((Fl_Font)i),n)) {free(n);return 1;}
char buffer[LF_FACESIZE + 1];
strcpy(buffer+1, n);
- buffer[0] = ' '; Fl::set_font((Fl_Font)(fl_free_font++), strdup(buffer));
+ buffer[0] = ' '; Fl::set_font((Fl_Font)(fl_free_font++), fl_strdup(buffer));
if (lpelf->lfWeight <= 400)
- buffer[0] = 'B', Fl::set_font((Fl_Font)(fl_free_font++), strdup(buffer));
- buffer[0] = 'I'; Fl::set_font((Fl_Font)(fl_free_font++), strdup(buffer));
+ buffer[0] = 'B', Fl::set_font((Fl_Font)(fl_free_font++), fl_strdup(buffer));
+ buffer[0] = 'I'; Fl::set_font((Fl_Font)(fl_free_font++), fl_strdup(buffer));
if (lpelf->lfWeight <= 400)
- buffer[0] = 'P', Fl::set_font((Fl_Font)(fl_free_font++), strdup(buffer));
+ buffer[0] = 'P', Fl::set_font((Fl_Font)(fl_free_font++), fl_strdup(buffer));
free(n);
return 1;
} /* enumcbw */