Use memmove() instead of memcpy() in several key places.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2672 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2002-10-11 14:17:24 +00:00
parent fddb73a5f2
commit be58513af7
7 changed files with 20 additions and 17 deletions

View File

@ -1,5 +1,8 @@
CHANGES IN FLTK 1.1.1
- Replaced several memcpy's with memmove's for
portability (memmove allows for overlapping copies,
memcpy does not)
- Bug #621737: Fl_Bitmap::copy(), Fl_Pixmap::copy(), and
Fl_RGB_Image::copy() now range-check the new width and
height to make sure they are positive integers.

View File

@ -1,4 +1,4 @@
// generated by Fast Light User Interface Designer (fluid) version 1.0100
// generated by Fast Light User Interface Designer (fluid) version 1.0101
#ifndef Fl_Help_Dialog_H
#define Fl_Help_Dialog_H

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Image.H,v 1.5.2.3.2.15 2002/08/14 16:19:48 easysw Exp $"
// "$Id: Fl_Image.H,v 1.5.2.3.2.16 2002/10/11 14:17:20 easysw Exp $"
//
// Image header file for the Fast Light Tool Kit (FLTK).
//
@ -24,7 +24,7 @@
//
#ifndef Fl_Image_H
#define Fl_Image_H
# define Fl_Image_H
# include "x.H"
@ -97,8 +97,8 @@ class FL_EXPORT Fl_RGB_Image : public Fl_Image {
virtual void uncache();
};
#endif
#endif // !Fl_Image_H
//
// End of "$Id: Fl_Image.H,v 1.5.2.3.2.15 2002/08/14 16:19:48 easysw Exp $".
// End of "$Id: Fl_Image.H,v 1.5.2.3.2.16 2002/10/11 14:17:20 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Chart.cxx,v 1.5.2.6.2.10 2002/09/04 20:33:18 easysw Exp $"
// "$Id: Fl_Chart.cxx,v 1.5.2.6.2.11 2002/10/11 14:17:21 easysw Exp $"
//
// Forms-compatible chart widget for the Fast Light Tool Kit (FLTK).
//
@ -315,7 +315,7 @@ void Fl_Chart::add(double val, const char *str, unsigned col) {
}
// Shift entries as needed
if (numb >= maxnumb && maxnumb > 0) {
memcpy(entries, entries + 1, sizeof(FL_CHART_ENTRY) * (numb - 1));
memmove(entries, entries + 1, sizeof(FL_CHART_ENTRY) * (numb - 1));
numb --;
}
entries[numb].val = float(val);
@ -384,5 +384,5 @@ void Fl_Chart::maxsize(int m) {
}
//
// End of "$Id: Fl_Chart.cxx,v 1.5.2.6.2.10 2002/09/04 20:33:18 easysw Exp $".
// End of "$Id: Fl_Chart.cxx,v 1.5.2.6.2.11 2002/10/11 14:17:21 easysw Exp $".
//

View File

@ -1,4 +1,4 @@
// generated by Fast Light User Interface Designer (fluid) version 1.0100
// generated by Fast Light User Interface Designer (fluid) version 1.0101
#include "../FL/Fl_Help_Dialog.H"
#include "flstring.h"
@ -11,8 +11,8 @@ inline void Fl_Help_Dialog::cb_view__i(Fl_Help_View*, void*) {
if (index_ >= 100)
{
memcpy(line_, line_ + 10, sizeof(line_[0]) * 90);
memcpy(file_, file_ + 10, sizeof(file_[0]) * 90);
memmove(line_, line_ + 10, sizeof(line_[0]) * 90);
memmove(file_, file_ + 10, sizeof(file_[0]) * 90);
index_ -= 10;
}

View File

@ -25,8 +25,8 @@ class Fl_Help_Dialog {open
if (index_ >= 100)
{
memcpy(line_, line_ + 10, sizeof(line_[0]) * 90);
memcpy(file_, file_ + 10, sizeof(file_[0]) * 90);
memmove(line_, line_ + 10, sizeof(line_[0]) * 90);
memmove(file_, file_ + 10, sizeof(file_[0]) * 90);
index_ -= 10;
}

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Shared_Image.cxx,v 1.23.2.16 2002/08/09 01:09:49 easysw Exp $"
// "$Id: Fl_Shared_Image.cxx,v 1.23.2.17 2002/10/11 14:17:24 easysw Exp $"
//
// Shared image code for the Fast Light Tool Kit (FLTK).
//
@ -189,7 +189,7 @@ Fl_Shared_Image::release() {
num_images_ --;
if (i < num_images_) {
memcpy(images_ + i, images_ + i + 1,
memmove(images_ + i, images_ + i + 1,
(num_images_ - i) * sizeof(Fl_Shared_Image *));
}
@ -448,12 +448,12 @@ Fl_Shared_Image::remove_handler(Fl_Shared_Handler f) {
if (i < num_handlers_) {
// Shift later handlers down 1...
memcpy(handlers_ + i, handlers_ + i + 1,
memmove(handlers_ + i, handlers_ + i + 1,
(num_handlers_ - i) * sizeof(Fl_Shared_Handler ));
}
}
//
// End of "$Id: Fl_Shared_Image.cxx,v 1.23.2.16 2002/08/09 01:09:49 easysw Exp $".
// End of "$Id: Fl_Shared_Image.cxx,v 1.23.2.17 2002/10/11 14:17:24 easysw Exp $".
//