From: Han-Wen Nienhuys Date: Thu, 24 Aug 2006 12:20:38 +0000 (+0000) Subject: (string_copy): use copy () X-Git-Tag: cvs/HEAD~132 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ad7402e8833de98674ebf26c6c1c94ceef266d42;p=lilypond.git (string_copy): use copy () --- diff --git a/ChangeLog b/ChangeLog index f51b12190a..7d555541f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2006-08-24 Han-Wen Nienhuys + * flower/std-string.cc (string_copy): use copy () + * lily/source-file.cc (Source_file): use copy(). Remove contents_str0() 2006-08-24 Graham Percival diff --git a/flower/std-string.cc b/flower/std-string.cc index 304ddf33cf..4069278cb2 100644 --- a/flower/std-string.cc +++ b/flower/std-string.cc @@ -89,8 +89,9 @@ string_copy (string s) { ssize len = s.length (); char *dest = new char[len + 1]; - //s.copy (dest, len + 1); - memcpy (dest, s.c_str (), len + 1); + copy (s.begin (), s.end (), dest); + dest[len] = 0; + return dest; }