]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/general-scheme.cc
Issue 4895 Give SystemStartSquare a default of 5.0 for collapse-height
[lilypond.git] / lily / general-scheme.cc
index d661c177a5802837cc2f961c50d2b396363df211..02cf2fa76bf3c660a473b70da7ae543b574297af 100644 (file)
@@ -24,6 +24,7 @@
 #include <ctype.h>
 #include <cstring>  /* memset */
 #include <glib.h>
+using namespace std;
 
 #include "dimensions.hh"
 #include "file-name.hh"
@@ -39,9 +40,6 @@
 #include "version.hh"
 #include "warn.hh"
 
-using std::string;
-using std::vector;
-
 /* Declaration of log function(s) */
 SCM ly_progress (SCM, SCM);
 
@@ -597,7 +595,9 @@ LY_DEFINE (ly_format, "ly:format",
   char *ptr = result;
   for (vsize i = 0; i < results.size (); i++)
     {
-      strncpy (ptr, results[i].c_str (), results[i].size ());
+      // strcpy and strncpy cannot be used here
+      // because std::string may contain '\0' in its contents.
+      results[i].copy (ptr, results[i].size ());
       ptr += results[i].size ();
     }
   *ptr = '\0';