summaryrefslogtreecommitdiff
path: root/src/Fl_Chart.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_Chart.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_Chart.cxx')
-rw-r--r--src/Fl_Chart.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/Fl_Chart.cxx b/src/Fl_Chart.cxx
index 7fcb643d5..b3eabadc5 100644
--- a/src/Fl_Chart.cxx
+++ b/src/Fl_Chart.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Chart.cxx,v 1.5.2.6.2.6 2002/04/11 11:52:41 easysw Exp $"
+// "$Id: Fl_Chart.cxx,v 1.5.2.6.2.7 2002/05/16 12:47:43 easysw Exp $"
//
// Forms-compatible chart widget for the Fast Light Tool Kit (FLTK).
//
@@ -312,8 +312,7 @@ void Fl_Chart::add(double val, const char *str, unsigned col) {
entries[numb].val = float(val);
entries[numb].col = col;
if (str) {
- strncpy(entries[numb].str,str,FL_CHART_LABEL_MAX);
- entries[numb].str[FL_CHART_LABEL_MAX] = 0;
+ strlcpy(entries[numb].str,str,FL_CHART_LABEL_MAX + 1);
} else {
entries[numb].str[0] = 0;
}
@@ -336,8 +335,7 @@ void Fl_Chart::insert(int index, double val, const char *str, unsigned col) {
entries[index-1].val = float(val);
entries[index-1].col = col;
if (str) {
- strncpy(entries[index-1].str,str,FL_CHART_LABEL_MAX);
- entries[index-1].str[FL_CHART_LABEL_MAX] = 0;
+ strlcpy(entries[index-1].str,str,FL_CHART_LABEL_MAX+1);
} else {
entries[index-1].str[0] = 0;
}
@@ -349,8 +347,7 @@ void Fl_Chart::replace(int index,double val, const char *str, unsigned col) {
entries[index-1].val = float(val);
entries[index-1].col = col;
if (str) {
- strncpy(entries[index-1].str,str,FL_CHART_LABEL_MAX);
- entries[index-1].str[FL_CHART_LABEL_MAX] = 0;
+ strlcpy(entries[index-1].str,str,FL_CHART_LABEL_MAX+1);
} else {
entries[index-1].str[0] = 0;
}
@@ -378,5 +375,5 @@ void Fl_Chart::maxsize(int m) {
}
//
-// End of "$Id: Fl_Chart.cxx,v 1.5.2.6.2.6 2002/04/11 11:52:41 easysw Exp $".
+// End of "$Id: Fl_Chart.cxx,v 1.5.2.6.2.7 2002/05/16 12:47:43 easysw Exp $".
//