summaryrefslogtreecommitdiff
path: root/src/Fl_File_Icon2.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-08-09 01:09:49 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-08-09 01:09:49 +0000
commita6b935289ed59305318929b857bf74f671125e87 (patch)
tree20398a4cc1c49f2309b0b607e331aea2c433e17b /src/Fl_File_Icon2.cxx
parent27a54dc22bb9b2fbb16b01a04cd8479d25470bec (diff)
Move the rest of the image file formats (except for XBM and XPM) to
the fltk_images library; saves about 16k in the FLTK core library on my Intel system. Fix a memory leak bug in most of the fl_set_fonts*.cxx implementations; as a result, the Fl_Fontdesc structure now has a fontname member to old the human-readable font name. Lots of fixes for shadowed variables, etc. Use snprintf, strlcpy, and strlcat in more places. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2566 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_File_Icon2.cxx')
-rw-r--r--src/Fl_File_Icon2.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/Fl_File_Icon2.cxx b/src/Fl_File_Icon2.cxx
index 5a2683e83..78030c014 100644
--- a/src/Fl_File_Icon2.cxx
+++ b/src/Fl_File_Icon2.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_File_Icon2.cxx,v 1.1.2.15 2002/06/28 21:04:36 easysw Exp $"
+// "$Id: Fl_File_Icon2.cxx,v 1.1.2.16 2002/08/09 01:09:48 easysw Exp $"
//
// Fl_File_Icon system icon routines.
//
@@ -777,9 +777,7 @@ load_kde_icons(const char *directory) // I - Directory to load
{
if (entries[i]->d_name[0] != '.')
{
- strcpy(full, directory);
- strcat(full,"/");
- strcat(full, entries[i]->d_name);
+ snprintf(full, sizeof(full), "%s/%s", directory, entries[i]->d_name);
if (fl_filename_isdir(full))
load_kde_icons(full);
@@ -820,11 +818,11 @@ load_kde_mimelnk(const char *filename)
while (fgets(tmp, sizeof(tmp), fp))
{
if ((val = get_kde_val(tmp, "Icon")) != NULL)
- strcpy(iconfilename, val);
+ strlcpy(iconfilename, val, sizeof(iconfilename));
else if ((val = get_kde_val(tmp, "MimeType")) != NULL)
- strcpy(mimetype, val);
+ strlcpy(mimetype, val, sizeof(mimetype));
else if ((val = get_kde_val(tmp, "Patterns")) != NULL)
- strcpy(pattern, val);
+ strlcpy(pattern, val, sizeof(pattern));
}
fclose(fp);
@@ -902,7 +900,7 @@ kde_to_fltk_pattern(const char *kdepattern)
pattern = (char *)malloc(strlen(kdepattern) + 3);
strcpy(pattern, "{");
- strcat(pattern, kdepattern);
+ strcpy(pattern + 1, kdepattern);
if (pattern[strlen(pattern) - 1] == ';')
pattern[strlen(pattern) - 1] = '\0';
@@ -944,5 +942,5 @@ get_kde_val(char *str,
//
-// End of "$Id: Fl_File_Icon2.cxx,v 1.1.2.15 2002/06/28 21:04:36 easysw Exp $".
+// End of "$Id: Fl_File_Icon2.cxx,v 1.1.2.16 2002/08/09 01:09:48 easysw Exp $".
//