diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-05-16 12:47:44 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-05-16 12:47:44 +0000 |
| commit | 88d54cd78bf73348e4f207ab3f741aa374f28b1c (patch) | |
| tree | d9310acf36b480d31f0c1527520fe7376f7953ca /src/fl_file_dir.cxx | |
| parent | 36546824762618bbe76d4ac72b632ca9927acd9f (diff) | |
Massive update to use strlcpy() and strlcat() instead of strncpy()
and strncat() in almost all places (there are still a few strncpy's
that need to be used...)
Added configure check for strlcat() and strlcpy().
Added emulation code for strlcat() and strlcpy().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2239 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_file_dir.cxx')
| -rw-r--r-- | src/fl_file_dir.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/fl_file_dir.cxx b/src/fl_file_dir.cxx index 1d3899a53..97c60a9a1 100644 --- a/src/fl_file_dir.cxx +++ b/src/fl_file_dir.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_file_dir.cxx,v 1.1.2.11 2002/05/01 13:52:25 easysw Exp $" +// "$Id: fl_file_dir.cxx,v 1.1.2.12 2002/05/16 12:47:43 easysw Exp $" // // File chooser widget for the Fast Light Tool Kit (FLTK). // @@ -23,7 +23,7 @@ // Please report all bugs and problems to "fltk-bugs@fltk.org". // -#include <config.h> +#include "flstring.h" #include <FL/filename.H> #include <FL/Fl_File_Chooser.H> #include <FL/Fl_File_Chooser.H> @@ -68,8 +68,7 @@ fl_file_chooser(const char *message, // I - Message in titlebar if (fc->filter() != pat && (!pat || !fc->filter() || strcmp(pat, fc->filter())) && fc->value()) { // if pattern is different, remove name but leave old directory: - strncpy(retname, fc->value(), sizeof(retname) - 1); - retname[sizeof(retname) - 1] = '\0'; + strlcpy(retname, fc->value(), sizeof(retname)); char *p = strrchr(retname, '/'); @@ -143,5 +142,5 @@ fl_dir_chooser(const char *message, // I - Message for titlebar // -// End of "$Id: fl_file_dir.cxx,v 1.1.2.11 2002/05/01 13:52:25 easysw Exp $". +// End of "$Id: fl_file_dir.cxx,v 1.1.2.12 2002/05/16 12:47:43 easysw Exp $". // |
