From f1c9b198bba52d19a840efc7a77a9752d711ee57 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 2 Mar 2024 23:49:35 +0100 Subject: Promote fl_strlcpy to --- test/editor.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/editor.cxx') diff --git a/test/editor.cxx b/test/editor.cxx index a6ab7734c..360e3eed7 100644 --- a/test/editor.cxx +++ b/test/editor.cxx @@ -26,7 +26,6 @@ #include #include -#include Fl_Double_Window *app_window = NULL; @@ -50,6 +49,7 @@ int main (int argc, char **argv) { #include #include #include +#include Fl_Menu_Bar *app_menu_bar = NULL; bool text_changed = false; @@ -81,7 +81,7 @@ void set_changed(bool v) { void set_filename(const char *new_filename) { if (new_filename) { - strlcpy(app_filename, new_filename, FL_PATH_MAX); + fl_strlcpy(app_filename, new_filename, FL_PATH_MAX); } else { app_filename[0] = 0; } @@ -188,7 +188,7 @@ void menu_save_as_callback(Fl_Widget*, void*) { file_chooser.type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE); if (app_filename[0]) { char temp_filename[FL_PATH_MAX]; - strlcpy(temp_filename, app_filename, FL_PATH_MAX); + fl_strlcpy(temp_filename, app_filename, FL_PATH_MAX); const char *name = fl_filename_name(temp_filename); if (name) { file_chooser.preset_file(name); @@ -263,7 +263,7 @@ void menu_open_callback(Fl_Widget*, void*) { file_chooser.type(Fl_Native_File_Chooser::BROWSE_FILE); if (app_filename[0]) { char temp_filename[FL_PATH_MAX]; - strlcpy(temp_filename, app_filename, FL_PATH_MAX); + fl_strlcpy(temp_filename, app_filename, FL_PATH_MAX); const char *name = fl_filename_name(temp_filename); if (name) { file_chooser.preset_file(name); @@ -399,7 +399,7 @@ bool find_next(const char *needle) { void menu_find_callback(Fl_Widget*, void* v) { const char *find_text = fl_input("Find in text:", last_find_text); if (find_text) { - strlcpy(last_find_text, find_text, sizeof(last_find_text)); + fl_strlcpy(last_find_text, find_text, sizeof(last_find_text)); find_next(find_text); } } @@ -497,8 +497,8 @@ void Replace_Dialog::show() { void Replace_Dialog::find_next_callback(Fl_Widget*, void* my_dialog) { Replace_Dialog *dlg = static_cast(my_dialog); - strlcpy(last_find_text, dlg->find_text_input->value(), sizeof(last_find_text)); - strlcpy(last_replace_text, dlg->replace_text_input->value(), sizeof(last_replace_text)); + fl_strlcpy(last_find_text, dlg->find_text_input->value(), sizeof(last_find_text)); + fl_strlcpy(last_replace_text, dlg->replace_text_input->value(), sizeof(last_replace_text)); if (last_find_text[0]) find_next(last_find_text); } -- cgit v1.2.3