develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34224 - trunk/compilers/imcc

From:
petdance
Date:
December 21, 2008 19:43
Subject:
[svn:parrot] r34224 - trunk/compilers/imcc
Message ID:
20081222034304.20A51CBA12@x12.develooper.com
Author: petdance
Date: Sun Dec 21 19:43:03 2008
New Revision: 34224

Modified:
   trunk/compilers/imcc/optimizer.c

Log:
Make the sprintf arguments a const char, not a buffer

Modified: trunk/compilers/imcc/optimizer.c
==============================================================================
--- trunk/compilers/imcc/optimizer.c	(original)
+++ trunk/compilers/imcc/optimizer.c	Sun Dec 21 19:43:03 2008
@@ -929,22 +929,23 @@
     };
 
     size_t i;
-    char fmt[64], op[20];
+    const char *fmt;
+    char op[20];
     const char *debug_fmt = NULL;   /* gcc -O uninit warn */
     int found, branched;
 
     /* construct a FLOATVAL_FMT with needed precision */
     switch (NUMVAL_SIZE) {
         case 8:
-            strcpy(fmt, "%0.16g");
+            fmt = "%0.16g";
             break;
         case 12:
-            strcpy(fmt, "%0.18Lg");
+            fmt = "%0.18Lg";
             break;
         default:
             IMCC_warning(interp, "subs_constants",
                     "used default FLOATVAL_FMT\n");
-            strcpy(fmt, FLOATVAL_FMT);
+            fmt = FLOATVAL_FMT;
             break;
     }
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About