summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/table-as-container.cxx3
-rw-r--r--examples/table-sort.cxx3
2 files changed, 4 insertions, 2 deletions
diff --git a/examples/table-as-container.cxx b/examples/table-as-container.cxx
index 515ad884f..838c55512 100644
--- a/examples/table-as-container.cxx
+++ b/examples/table-as-container.cxx
@@ -31,6 +31,7 @@
#include <FL/Fl_Input.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Table.H>
+#include <FL/fl_string.h> // fl_strdup()
void button_cb(Fl_Widget *w, void*);
@@ -75,7 +76,7 @@ public:
} else {
// Create the light buttons
sprintf(s, "%d/%d ", r, c);
- Fl_Light_Button *butt = new Fl_Light_Button(X,Y,W,H,strdup(s));
+ Fl_Light_Button *butt = new Fl_Light_Button(X,Y,W,H,fl_strdup(s));
butt->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
butt->callback(button_cb, (void*)0);
butt->value( ((r+c*2) & 4 ) ? 1 : 0);
diff --git a/examples/table-sort.cxx b/examples/table-sort.cxx
index d492bf54c..a907af92f 100644
--- a/examples/table-sort.cxx
+++ b/examples/table-sort.cxx
@@ -26,6 +26,7 @@
#include <FL/Fl_Double_Window.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Table_Row.H>
+#include <FL/fl_string.h>
#include <stdio.h>
#include <string.h>
@@ -225,7 +226,7 @@ void MyTable::load_command(const char *cmd) {
char *ss;
const char *delim = " \t\n";
for(int t=0; (t==0)?(ss=strtok(s,delim)):(ss=strtok(NULL,delim)); t++) {
- rc.push_back(strdup(ss));
+ rc.push_back(fl_strdup(ss));
}
// Keep track of max # columns
if ( (int)rc.size() > cols() ) {