]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/general-scheme.cc
* lily/general-scheme.cc (LY_DEFINE): Use snprintf (WAS: sprintf).
[lilypond.git] / lily / general-scheme.cc
index 895bf043650b210c8b1fcfd13f4b0c86fc4fcb77..727bdeb73bace1270dba0f7a75a27c03a035fc66 100644 (file)
@@ -7,8 +7,13 @@
                  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "config.hh"
+
 #include <math.h>   /* isinf */
+#include <stdio.h>
+#include <libintl.h>           // gettext on macos x
 
+#include "libc-extension.hh"
 #include "lily-guile.hh"
 #include "string.hh"
 #include "misc.hh"
@@ -115,10 +120,10 @@ LY_DEFINE (ly_number2string, "ly:number->string",
          r = 0.0;
        }
 
-      sprintf (str, "%08.4f", r);
+      snprintf (str, sizeof (str), "%08.4f", r);
     }
   else
-    sprintf (str, "%d", scm_to_int (s));
+    snprintf (str, sizeof (str), "%d", scm_to_int (s));
 
   return scm_makfrom0str (str);
 }