summaryrefslogtreecommitdiff
path: root/fluid/fluid.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-05-16 12:47:44 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-05-16 12:47:44 +0000
commit88d54cd78bf73348e4f207ab3f741aa374f28b1c (patch)
treed9310acf36b480d31f0c1527520fe7376f7953ca /fluid/fluid.cxx
parent36546824762618bbe76d4ac72b632ca9927acd9f (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 'fluid/fluid.cxx')
-rw-r--r--fluid/fluid.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx
index e683c4cfd..1f8bbc8d7 100644
--- a/fluid/fluid.cxx
+++ b/fluid/fluid.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fluid.cxx,v 1.15.2.13.2.25 2002/05/02 10:08:44 easysw Exp $"
+// "$Id: fluid.cxx,v 1.15.2.13.2.26 2002/05/16 12:47:43 easysw Exp $"
//
// FLUID main entry for the Fast Light Tool Kit (FLTK).
//
@@ -39,8 +39,6 @@
#include <FL/filename.H>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
#include <errno.h>
#include "../src/flstring.h"
@@ -298,7 +296,7 @@ static char* cutfname() {
if (!beenhere) {
beenhere = 1;
fluid_prefs.getUserdataPath(name, sizeof(name));
- strncat(name, "cut_buffer", sizeof(name) - 1);
+ strlcat(name, "cut_buffer", sizeof(name));
// getUserdataPath zeros the "name" buffer...
}
@@ -565,8 +563,7 @@ void update_history(const char *filename) {
i * sizeof(relative_history[0]));
// Put the new file at the top...
- strncpy(absolute_history[0], absolute, sizeof(absolute_history[0]) - 1);
- absolute_history[0][sizeof(absolute_history[0]) - 1] = '\0';
+ strlcpy(absolute_history[0], absolute, sizeof(absolute_history[0]));
fl_filename_relative(relative_history[0], sizeof(relative_history[0]),
absolute_history[0]);
@@ -798,5 +795,5 @@ int main(int argc,char **argv) {
}
//
-// End of "$Id: fluid.cxx,v 1.15.2.13.2.25 2002/05/02 10:08:44 easysw Exp $".
+// End of "$Id: fluid.cxx,v 1.15.2.13.2.26 2002/05/16 12:47:43 easysw Exp $".
//