X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fgeneral-scheme.cc;h=02cf2fa76bf3c660a473b70da7ae543b574297af;hb=60ceca32eb997a6ce3a974527b39a098d1ebb82e;hp=de5a2cc225be4f3f8ca2dd068ed471b0c0e116dd;hpb=1de3d397c18622b6061402fef18e625701712bc5;p=lilypond.git diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc index de5a2cc225..02cf2fa76b 100644 --- a/lily/general-scheme.cc +++ b/lily/general-scheme.cc @@ -40,9 +40,6 @@ using namespace std; #include "version.hh" #include "warn.hh" -using std::string; -using std::vector; - /* Declaration of log function(s) */ SCM ly_progress (SCM, SCM); @@ -598,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';