summaryrefslogtreecommitdiff
path: root/src/Fl_Text_Buffer.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 /src/Fl_Text_Buffer.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 'src/Fl_Text_Buffer.cxx')
-rw-r--r--src/Fl_Text_Buffer.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx
index fba4d4800..68aafd9a8 100644
--- a/src/Fl_Text_Buffer.cxx
+++ b/src/Fl_Text_Buffer.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Text_Buffer.cxx,v 1.9.2.5 2002/05/03 20:30:19 easysw Exp $"
+// "$Id: Fl_Text_Buffer.cxx,v 1.9.2.6 2002/05/16 12:47:43 easysw Exp $"
//
// Copyright 2001-2002 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
@@ -2034,8 +2034,7 @@ static char *copyLine( const char *text, int *lineLen ) {
for ( c = text; *c != '\0' && *c != '\n'; c++ )
len++;
outStr = (char *)malloc( len + 1 );
- strncpy( outStr, text, len );
- outStr[ len ] = '\0';
+ strlcpy( outStr, text, len + 1);
*lineLen = len;
return outStr;
}
@@ -2285,5 +2284,5 @@ Fl_Text_Buffer::outputfile(const char *file, int start, int end, int buflen) {
//
-// End of "$Id: Fl_Text_Buffer.cxx,v 1.9.2.5 2002/05/03 20:30:19 easysw Exp $".
+// End of "$Id: Fl_Text_Buffer.cxx,v 1.9.2.6 2002/05/16 12:47:43 easysw Exp $".
//