sim: bfin: simplify field width processing and fix build warnings
[deliverable/binutils-gdb.git] / sim / bfin / bfin-sim.c
index 2c93e04a185121eb0d51db46800f1b6c79a8c4f1..54d6bcad3462e0d5d7f3425c5d05db8f81c91293 100644 (file)
@@ -223,16 +223,7 @@ fmtconst_str (const_forms_t cf, bs32 x, bu32 pc)
     x <<= constant_formats[cf].scale;
 
   if (constant_formats[cf].decimal)
-    {
-      if (constant_formats[cf].leading)
-       {
-         char ps[10];
-         sprintf (ps, "%%%ii", constant_formats[cf].leading);
-         sprintf (buf, ps, x);
-       }
-      else
-       sprintf (buf, "%i", x);
-    }
+    sprintf (buf, "%*i", constant_formats[cf].leading, x);
   else
     {
       if (constant_formats[cf].issigned && x < 0)
This page took 0.024417 seconds and 4 git commands to generate.