summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fluid/code.cxx2
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx9
2 files changed, 5 insertions, 6 deletions
diff --git a/fluid/code.cxx b/fluid/code.cxx
index bfbec1086..192e21149 100644
--- a/fluid/code.cxx
+++ b/fluid/code.cxx
@@ -131,8 +131,6 @@ int write_strings(const Fl_String &filename) {
}
if (w->tooltip()) {
- const char *s;
-
fputs("msgid \"", fp);
write_escaped_strings(fp, w->tooltip());
fputs("\"\n", fp);
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx
index 94d013b3f..8ba7fb908 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx
@@ -452,21 +452,22 @@ int fl_correct_encoding(const char* name) {
static const char *find_best_font(const char *fname, int size) {
int cnt;
static char **list = NULL;
-// locate or create an Fl_Font_Descriptor for a given Fl_Fontdesc and size:
+ // note: namebuffer must be static: its address may be returned to caller
+ static char namebuffer[1024]; // holds scalable font name
+ // locate or create an Fl_Font_Descriptor for a given Fl_Fontdesc and size:
if (list) XFreeFontNames(list);
list = XListFonts(fl_display, fname, 100, &cnt);
if (!list) return "fixed";
// search for largest <= font size:
- char* name = list[0]; int ptsize = 0; // best one found so far
+ char* name = list[0]; int ptsize = 0; // best one found so far
int matchedlength = 32767;
- char namebuffer[1024]; // holds scalable font name
int found_encoding = 0;
int m = cnt; if (m<0) m = -m;
for (int n=0; n < m; n++) {
char* thisname = list[n];
if (fl_correct_encoding(thisname)) {
- if (!found_encoding) ptsize = 0; // force it to choose this
+ if (!found_encoding) ptsize = 0; // force it to choose this
found_encoding = 1;
} else {
if (found_encoding) continue;