From 9f6e3d4d10c38c370faecbe134ffe40948f66c0a Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 24 Aug 2006 12:20:35 +0000 Subject: [PATCH] (string_copy): use copy () --- ChangeLog | 2 ++ flower/std-string.cc | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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; } -- 2.39.2