summaryrefslogtreecommitdiff
path: root/src/fl_draw.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_draw.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_draw.cxx')
-rw-r--r--src/fl_draw.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/fl_draw.cxx b/src/fl_draw.cxx
index 0e0463943..535bbcc46 100644
--- a/src/fl_draw.cxx
+++ b/src/fl_draw.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fl_draw.cxx,v 1.6.2.4.2.11 2002/04/11 11:52:42 easysw Exp $"
+// "$Id: fl_draw.cxx,v 1.6.2.4.2.12 2002/05/16 12:47:43 easysw Exp $"
//
// Label drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -144,8 +144,7 @@ void fl_draw(
}
if (str && (p = strrchr(str, '@')) != NULL && p > (str + 1)) {
- strncpy(symbol[1], p, sizeof(symbol[1]) - 1);
- symbol[1][sizeof(symbol[1]) - 1] = '\0';
+ strlcpy(symbol[1], p, sizeof(symbol[1]));
symwidth[1] = min(w,h);
}
}
@@ -300,8 +299,7 @@ void fl_measure(const char* str, int& w, int& h, int draw_symbols) {
}
if (str && (p = strrchr(str, '@')) != NULL && p > (str + 1)) {
- strncpy(symbol[1], p, sizeof(symbol[1]) - 1);
- symbol[1][sizeof(symbol[1]) - 1] = '\0';
+ strlcpy(symbol[1], p, sizeof(symbol[1]));
symwidth[1] = min(w,h);
}
@@ -327,5 +325,5 @@ void fl_measure(const char* str, int& w, int& h, int draw_symbols) {
}
//
-// End of "$Id: fl_draw.cxx,v 1.6.2.4.2.11 2002/04/11 11:52:42 easysw Exp $".
+// End of "$Id: fl_draw.cxx,v 1.6.2.4.2.12 2002/05/16 12:47:43 easysw Exp $".
//