FLTK logo

[master] 20f7db2 - Fluid: use fl_strdup() to fix MSVC compiler warning

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 20f7db2 - Fluid: use fl_strdup() to fix MSVC compiler warning "Albrecht Schlosser" Dec 11, 2021  
 
commit 20f7db27ba7dc1cf9b2afc4b0e2dc2dda9c8d4de
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Sat Dec 11 14:49:42 2021 +0100
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Sat Dec 11 14:49:42 2021 +0100

    Fluid: use fl_strdup() to fix MSVC compiler warning

 fluid/shell_command.cxx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git fluid/shell_command.cxx fluid/shell_command.cxx
index 14e46ab..1475259 100644
--- fluid/shell_command.cxx
+++ fluid/shell_command.cxx
@@ -21,6 +21,7 @@
 
 #include <FL/Fl_Double_Window.H>
 #include <FL/fl_message.H>
+#include <FL/fl_string.h>
 
 #include <errno.h>
 
@@ -88,7 +89,7 @@ void shell_settings_read()
     free((void*)g_shell_command);
   g_shell_command = NULL;
   if (shell_settings.command)
-    g_shell_command = strdup(shell_settings.command);
+    g_shell_command = fl_strdup(shell_settings.command);
   g_shell_save_fl = ((shell_settings.flags&1)==1);
   g_shell_save_code = ((shell_settings.flags&2)==2);
   g_shell_save_strings = ((shell_settings.flags&4)==4);
@@ -112,7 +113,7 @@ void shell_settings_write()
     free((void*)shell_settings.command);
   shell_settings.command = NULL;
   if (g_shell_command)
-    shell_settings.command = strdup(g_shell_command);
+    shell_settings.command = fl_strdup(g_shell_command);
   shell_settings.flags = 0;
   if (g_shell_save_fl)
     shell_settings.flags |= 1;
@@ -364,7 +365,7 @@ void update_shell_window() {
 void apply_shell_window() {
   if (g_shell_command)
     free((void*)g_shell_command);
-  g_shell_command = strdup(shell_command_input->value());
+  g_shell_command = fl_strdup(shell_command_input->value());
   g_shell_save_fl = shell_savefl_button->value();
   g_shell_save_code = shell_writecode_button->value();
   g_shell_save_strings = shell_writemsgs_button->value();
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.