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/fl_set_fonts_mac.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/fl_set_fonts_mac.cxx')
| -rw-r--r-- | src/fl_set_fonts_mac.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fl_set_fonts_mac.cxx b/src/fl_set_fonts_mac.cxx index 40502aff8..c35c1cf6f 100644 --- a/src/fl_set_fonts_mac.cxx +++ b/src/fl_set_fonts_mac.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_set_fonts_mac.cxx,v 1.1.2.5 2002/04/27 18:37:15 easysw Exp $" +// "$Id: fl_set_fonts_mac.cxx,v 1.1.2.6 2002/05/16 12:47:43 easysw Exp $" // // MacOS font utilities for the Fast Light Tool Kit (FLTK). // @@ -107,7 +107,9 @@ int Fl::get_font_sizes(Fl_Font fnum, int*& sizep) { if (!s->name) s = fl_fonts; // empty slot in table, use entry 0 Str255 name; - int len = strlen( s->name ); strncpy( (char*)(name+1), s->name+1, len ); name[0] = len-1; + int len = strlen( s->name ); + memcpy(((char*)name)+1, s->name+1, len ); + name[0] = len-1; FMFontFamily family = FMGetFontFamilyFromName( name ); if ( family == kInvalidFontFamily ) return 0; @@ -152,5 +154,5 @@ int Fl::get_font_sizes(Fl_Font fnum, int*& sizep) { } // -// End of "$Id: fl_set_fonts_mac.cxx,v 1.1.2.5 2002/04/27 18:37:15 easysw Exp $". +// End of "$Id: fl_set_fonts_mac.cxx,v 1.1.2.6 2002/05/16 12:47:43 easysw Exp $". // |
