]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/string-data.icc
* The grand 2005-2006 replace.
[lilypond.git] / flower / include / string-data.icc
index 2f759ff8a1a2d838474df91edf34b9618e695852..fd603d532fe21edf8f2313ae2c4b8a6c8bfaf0e5 100644 (file)
@@ -3,18 +3,20 @@
 
    source file of Flower lib
 
-   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+   (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #ifndef STRINGDATA_INL
 #define STRINGDATA_INL
 
+#include "string-data.hh"
+
+#include <algorithm>
 #include <cassert>
 #include <cstring>
+#include <memory>
+using namespace std;
 
-#include <memory.h>
-
-#include "string-data.hh"
 const int INITIALMAX = 8;
 
 #include <sys/types.h>
@@ -90,7 +92,7 @@ String_data::remax (int j)
   if (j > maxlen)
     {
       Byte *p = new Byte[j + 1];
-      memcpy (p, data_byte_, (maxlen <? length_) + 1);
+      memcpy (p, data_byte_, min (maxlen, length_) + 1);
       maxlen = j;
       delete[] data_byte_;
       data_byte_ = p;