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;
     }
 

Reply via email to