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/filename_setext.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/filename_setext.cxx')
| -rw-r--r-- | src/filename_setext.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/filename_setext.cxx b/src/filename_setext.cxx index e2e9b8990..39fb3ee3a 100644 --- a/src/filename_setext.cxx +++ b/src/filename_setext.cxx @@ -1,5 +1,5 @@ // -// "$Id: filename_setext.cxx,v 1.4.2.3.2.4 2002/04/11 11:52:42 easysw Exp $" +// "$Id: filename_setext.cxx,v 1.4.2.3.2.5 2002/05/16 12:47:43 easysw Exp $" // // Filename extension routines for the Fast Light Tool Kit (FLTK). // @@ -33,13 +33,12 @@ char *fl_filename_setext(char *buf, int buflen, const char *ext) { char *q = (char *)fl_filename_ext(buf); if (ext) { - strncpy(q,ext,buflen - (q - buf) - 1); - buf[buflen - 1] = '\0'; + strlcpy(q,ext,buflen - (q - buf)); } else *q = 0; return(buf); } // -// End of "$Id: filename_setext.cxx,v 1.4.2.3.2.4 2002/04/11 11:52:42 easysw Exp $". +// End of "$Id: filename_setext.cxx,v 1.4.2.3.2.5 2002/05/16 12:47:43 easysw Exp $". // |
